leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.14k stars 247 forks source link

Where should I put public files? #701

Closed ghoomfrog closed 4 years ago

ghoomfrog commented 4 years ago

Like stylesheets for example.

leafo commented 4 years ago

there is no convention. You can put them in a folder of your choosing, then set up a location with nginx that points to that directory

ghoomfrog commented 4 years ago

@leafo I have put a stylesheet inside public/ and did this:

location / {
  alias public/;
  ...
}

But the stylesheet hasn't been recognized.

leafo commented 4 years ago

Here's how I do it on streak.club if that helps: https://github.com/leafo/streak.club/blob/master/nginx.conf#L69

    location /static/ {
      alias static/;
      access_log off;
      gzip on;
      gzip_types application/x-javascript text/css;
    }

then you would access a url like: http://streak.club/static/manifest.json

ghoomfrog commented 4 years ago

@leafo Something's really wrong with my app.