misultin
misultin copied to clipboard
How can i correctly return static files
Hello,
I have standard erlang directory structure. In priv directory i have js dir with javascript files and index.html - main page.
I started misultin:
misultin:start_link([{port, 2000}, {static, "/home/user/testproject/priv/"},
{loop, fun(Req) -> handle_http(Req) end}]),
Now what i must write in handle_http to return index.html with correctly loaded js files?
Thank you.
just visit http://127.0.0.1:2000/static/index.html, it should work. The path must start with /static/.