mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 04:10:24 +00:00
Fix upload example
This commit is contained in:
parent
44f16f3b1e
commit
57901a7116
2 changed files with 32 additions and 4 deletions
|
@ -13,12 +13,12 @@ start(_Type, _Args) ->
|
|||
Dispatch = cowboy_router:compile([
|
||||
{'_', [
|
||||
{"/", cowboy_static, {priv_file, upload, "index.html"}},
|
||||
{"/upload", upload_handler, []},
|
||||
{"/files/[...]", cowboy_static, {priv_dir, upload, "files"}}
|
||||
{"/upload", upload_handler, []}
|
||||
]}
|
||||
]),
|
||||
{ok, _} = cowboy:start_http(http, 100, [{port, 8080}],
|
||||
[{env, [{dispatch, Dispatch}]}]),
|
||||
{ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{
|
||||
env => #{dispatch => Dispatch}
|
||||
}),
|
||||
upload_sup:start_link().
|
||||
|
||||
stop(_State) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue