Closed AritraBanik08 closed 6 months ago
can anyone tell me why the static files in the folder public are not working?
Hi @AritraBanik08
If you use the basic routing, then it's straight forward like this:
settings:
staticDir = "tests/public"
routes:
get "/":
resp "Hello World"
And then ensure your are in the parent directory to tests/public
. Files located in the public will then be fetched directly, like: curl 127.0.0.1:5000/tests/public/test.txt
.
If you are using the method from example2.nim
, then you need to dive into jesters code to ensure, that the handler for static-dir matching is used. Your code example only "approves" two routes - which does not include the static-dir.
Hello @ThomasTJdev can you please help me to do it along with the method shown in example2.nim. Thank you for your help
I am creating the links shown in this example here. Can anyone help me with this?