misultin icon indicating copy to clipboard operation
misultin copied to clipboard

How can i correctly return static files

Open 0xAX opened this issue 13 years ago • 1 comments

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.

0xAX avatar Jan 03 '13 14:01 0xAX

just visit http://127.0.0.1:2000/static/index.html, it should work. The path must start with /static/.

dongyuwei avatar Dec 18 '16 04:12 dongyuwei