Next: Registering handlers for HTTP methods, Previous: How to run a site with GNU Artanis, Up: GNU Artanis Basics [Contents]
It’s better to use (init-server) to init GNU Artanis.
(init-server #:statics '(png jpg jpeg ico html js css) #:cache-statics? #f #:exclude '())
#:statics
specifies the static files with the file name extensions. GNU Artanis is based on URL remapping, so the requested URL will have to end in the requested file name, matching the string defined, and returning the file without any extra defintions per file type. By default, it covers the most common static file types.
#:cache-statics?
controls whether the static files should be cached.
#:exclude
specifies the types should be excluded. This is useful when you want to generate files dynamically. Even JavaScript/CSS could be generated dynamically, so it depends your design.