heroku网页截图服务搭建流程:
基于nodejs与phantomjs可以在heroku上搭建网页截图服务(Screenshot as a Service)
示例页面:http://screenshot.bookshadow.com/
该服务基于github的项目https://github.com/fzaninotto/screenshot-as-a-service的heroku分支版本
- 1. git clone https://github.com/GoBoundless/screenshot-as-a-service.git
- 2. cd screenshot-as-a-service
- 3. npm install
- 4. heroku create --stack cedar --buildpack https://github.com/ddollar/heroku-buildpack-multi.git
- 5. 修改config/default.yaml,将path: '/tmp/' 修改为 '/app/tmp/' (heroku的/tmp/目录禁止程序写入,使用该目录直接部署会报错Error: ENOENT)
- 6. heroku config:set PATH=/app/bin:/app/node_modules/bin:/usr/local/bin:/usr/bin:/bin:/app/vendor/phantomjs/bin
- 7. git ...