someday, a stack
The current web services stack
Common stack combinations
for webservices i use nginx for two main things; handling SSL and proxying to other physical computers
the simplest entry that works for static file serving with svelte or hand rolled html is
server {
server_name bil.dev www.bil.dev;
root /home/bil/svelte/bil.dev/build;
index index.html;
}
in the above svelte example, i have nginx pointed directly at the build folder
the trick here is to treat the file hosting as a json index. this way we are able to source image information automatically rather than hardcoding it into svelte
server {
server_name files.bil.dev;
root /home/bil/files/bil.dev;
autoindex on;
autoindex_format json;
add_header Access-Control-Allow-Origin *;
}
It is important to add the CORS header here so that the fetch request will work
two great places for this architecture is hendersoncat.com to load up random images without needing to track them and bil.dev projects