Sven Gehring's Blog

I write about software, engineering and stupidly fun side projects.

Serving static assets on a subpath in Phoenix

2019-04-26 3 min read programming Sven Gehring
If you create a new Phoenix project, without using the --no-html flag, a static plug will be added to your endpoint. Because of this, a lot of people recommend to just edit that, if you want to serve static files from a subdirectory. However, this can get a bit tricky if you have data stored in different directories - or use Phoenix purely as an API. When someone asked about this on the elixir-lang Slack, my first response was: Continue reading