#How to serve a directory of flat files?
1 messages · Page 1 of 1 (latest)
I've been meaning to figure out how to do this in Elixir, but Gleam would be even better.
I suppose wisp.serve_static does what you want?
Erlang will have it in OTP 27 https://github.com/erlang/otp/pull/7299
Neat!
There's an implication from the docs that /public is a directory in the project,
But it seems to be trying to look in the fully qualified path at that location.
https://hexdocs.pm/wisp/wisp.html#serve_static
I have to add a ./public for it to be a relative path?
I've confirmed that a /home/<stuff ... >/public works,
Lending credence to my theory that it's checking the literal path instead of a relative one?
I spent a long time being confused, until I read the tests for wisp and found the relative import.
thats just how paths work everywhere isnt it? doesnt sound weird to me
To me it looked like the examples are using absolute paths, since they started with /
Following up: I was able to use the diff in that pull request to create am Elixir script that does what I need right now.
Thanks again!
@tight nacelle I'm writing an article for it, but it got derailed when I found a 14+ year old documentation issue in Erlang. I'll try to get it out tomorrow in #1047101890707603547 .