Can‘t resolve the priv_dir of application webtest_app

(webtest@127.0.0.1)1> =CRASH REPORT==== 12-Jul-2020::13:04:42.355875 ===
  crasher:
    initial call: cowboy_stream_h:request_process/3
    pid: <0.480.0>
    registered_name: []
    exception error: bad argument: "Can't resolve the priv_dir of application webtest_app"
      in function  cowboy_static:priv_path/2 (src/cowboy_static.erl, line 72)
      in call from cowboy_static:init_opts/2 (src/cowboy_static.erl, line 59)
      in call from cowboy_handler:execute/2 (src/cowboy_handler.erl, line 37)
      in call from cowboy_stream_h:execute/3 (src/cowboy_stream_h.erl, line 300)
      in call from cowboy_stream_h:request_process/3 (src/cowboy_stream_h.erl, line 291)
    ancestors: [<0.479.0>,<0.447.0>,<0.446.0>,ranch_sup,<0.435.0>]
    message_queue_len: 0
    messages: []
    links: [<0.479.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 28
    reductions: 364
  neighbours:

=ERROR REPORT==== 12-Jul-2020::13:04:42.356857 ===
Ranch listener my_http_listener, connection process <0.479.0>, stream 1 had its request process <0.480.0> exit with reason {badarg,"Can't resolve the priv_dir of application webtest_app"} and stacktrace [{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,72}]},{cowboy_static,init_opts,2,[{file,"src/cowboy_static.erl"},{line,59}]},{cowboy_handler,execute,2,[{file,"src/cowboy_handler.erl"},{line,37}]},{cowboy_stream_h,execute,3,[{file,"src/cowboy_stream_h.erl"},{line,300}]},{cowboy_stream_h,request_process,3,[{file,"src/cowboy_stream_h.erl"},{line,291}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]

 

Dispatch = cowboy_router:compile([
        {'_', 
            [
                % {"/test", hello_handler, []},
                {"/", cowboy_static, {priv_file, webtest, "login.html"}}
            ]
        }
    ]),

原因:

{"/", cowboy_static, {priv_file, webtest, "login.html"}} 中的webtest必须和文件ebin\webtest.app

里面的application配置的名字一样。

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

friendan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值