启动应用
使用 plackup -r bin/app.psgi
启动应用
[dancer@dancer-test ~]$ cd TEST-APP/
[dancer@dancer-test TEST-APP]$ ls
bin config.yml cpanfile environments lib Makefile.PL MANIFEST MANIFEST.SKIP public t views
[dancer@dancer-test TEST-APP]$ plackup -r bin/app.psgi
Watching bin/lib bin/app.psgi for file updates.
HTTP::Server::PSGI: Accepting connections at http://0:5000/
...
...
...
当前的窗口被抢占并且启动了一个监听端口 5000
代码语言:javascript复制[root@dancer-test ~]# netstat -ant | grep 5000
tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN
[root@dancer-test ~]#
此时可以访问此服务器的 5000 端口
Note: 此时的防火墙对于指定的端口要是放开的
这是第一次请求中前端产生的访问日志
代码语言:javascript复制[TEST::APP:7832] core @2015-11-27 17:41:17> looking for get / in /usr/local/share/perl5/Dancer2/Core/App.pm l. 1205
[TEST::APP:7832] core @2015-11-27 17:41:17> Entering hook core.app.before_request in (eval 66) l. 1
[TEST::APP:7832] core @2015-11-27 17:41:17> Entering hook core.app.after_request in (eval 66) l. 1
192.168.2.59 - - [27/Nov/2015:17:41:17 0800] "GET / HTTP/1.1" 200 5237 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
192.168.2.59 - - [27/Nov/2015:17:41:17 0800] "GET /css/style.css HTTP/1.1" 200 2850 "http://192.168.20.105:5000/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
192.168.2.59 - - [27/Nov/2015:17:41:17 0800] "GET /images/perldancer-bg.jpg HTTP/1.1" 200 7125 "http://192.168.20.105:5000/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
192.168.2.59 - - [27/Nov/2015:17:41:17 0800] "GET /images/perldancer.jpg HTTP/1.1" 200 2240 "http://192.168.20.105:5000/" "Mozi