#How to serve a directory of flat files?

1 messages · Page 1 of 1 (latest)

final helm
#

I'm interested in replacing my use of python -m http.server (or the custom script I wrote that modifies a few things) with Gleam. Is it currently possible to quickly server a directory of flat files locally?

#

I've been meaning to figure out how to do this in Elixir, but Gleam would be even better.

junior basalt
#

I suppose wisp.serve_static does what you want?

tight nacelle
final helm
#

Neat!

final helm
#

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.

junior basalt
#

thats just how paths work everywhere isnt it? doesnt sound weird to me

tight nacelle
#

To me it looked like the examples are using absolute paths, since they started with /

exotic elk
#

Either works

#

Normal path rules apply

final helm
final helm
#

@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 .