Total Pageviews

Friday 25 November 2016

搭建基于haskell的文件服务器snoyberg-file-server-demo

先按此文http://briteming.blogspot.com/2016/07/hakyll.html,搭建stack,ghc.

cd /usr/local
git clone https://github.com/snoyberg/file-server-demo snoyberg-file-server-demo
cd snoyberg-file-server-demo
nano ~/.stack/global-project/stack.yaml
(把base-4.5.1.0改为base-4.7.0.2
deepseq-1.3.0.2改为deepseq-1.4.2.0
lts-6.8改为lts-7.9 )

root@AR:/usr/local/snoyberg-file-server-demo# stack FileServer.hs
显示:Progress: 0/79
Progress: 38/79
Progress: 54/79
Progress: 67/79
Progress: 68/79
Completed 79 action(s).
Launching application (此行的意思是程序已在运行)

按ctrl+c,然后
root@AR:/usr/local/snoyberg-file-server-demo# nano FileServer.hs
(把run 8080 app改为run 7070 app,意思是修改FileServer.hs所绑定的端口为7070)
root@AR:/usr/local/snoyberg-file-server-demo# stack FileServer.hs > /dev/null &

访问http://vps_ip:7070即可看到这个file server的页面,在页面里,可以上传文件。
访问http://vps_ip:7070/browse/,可以看到snoyberg-file-server-demo目录的内容。

项目地址:https://github.com/snoyberg/file-server-demo/
https://github.com/snoyberg/file-server-demo/issues/2