codebuddies / backend

CodeBuddies back-end
https://codebuddies.org
GNU General Public License v3.0
20 stars 25 forks source link

serve static assets from nginx #105

Closed chris48s closed 4 years ago

chris48s commented 4 years ago

At the moment, the backend throws a 404 on any javascript or CSS files. This means the admin interface looks like this:

Screenshot at 2020-03-10 20-34-33

There is clearly intent to use make use of the admin backend e.g: https://github.com/codebuddies/backend/issues/84 . Enabling nginx to serve static assets makes it much more usable:

Screenshot at 2020-03-10 20-33-58

..which is nicer :)

In general, this is primarily an API project so the vast majority of production traffic will be serving JSON. Javascript and CSS is only likely to be served to a small handful of admin users so I'd propose this as a production setup. There's not really any point in spending time on a more elaborate solution like farming it out to a static object storage service (S3/Spaces/whatever) to optimise the 1% case.

BethanyG commented 4 years ago

Nice! Thank you so much for doing this! We would have eventually gotten to it..er..maybe.
But you fixed these, and now the Admin and "browsable API" are things of beauty. YAY!:

image

image

Agree that since this is probably the limit of "stuff" we'd be serving up as web pages, we don't really need a more elaborate setup for storage ATM.

BethanyG commented 4 years ago

@billglover - tagging you, just in case there's something I've missed or other setup/config considerations you might have. Would this be better made in your already existing PR, or are we fine merging this in separately?

lpatmo commented 4 years ago

YAY thank you @chris48s!! 🚀

billglover commented 4 years ago

Yey! 🚢

Let's get these merged. I'll take care of updating open PR for staging deployment separately as I need to figure out to deploy these.

BethanyG commented 4 years ago

Mashing the big, green button. 🚢 🚀