Screenshot webpages using phantomJS
This Api uses
- NodeJS ( version >= 7 )
- Nodemon
- PhantomJS ( For capturing webpage images )
- Express ( For creating endpoint )
- Pm2 ( For running application in production )
Fire up your terminal
git clone https://github.com/manojsinghnegiwd/screenshot-webpage-server.git
cd screenshot-webpage-server
npm install
npm run devYour server is started on port 3000 in your browser go to
http://localhost:3000/screenshot?url=http://www.google.com
Put any url in place of http://www.google.com. You will get image as the response of the request. Checkout live version here http://www.manojsinghnegi.com/screenshot?url=http://www.manojsinghnegi.com
url: Address of the webpage to take screenshot ofwidth: viewport width ( default is1360)height: viewport height ( default is768)format: default israwcan be change tobase64
You will get an image as the reponse of the request. Images will be saved in assets folder for future use and serverd at http://localhost:(port)/shots.
npm run dev: start the server on port 3000npm run prod: start the server on port 8080npm run stop: stop the server when on production mode
- My website (manojsinghnegi.com)
- Github (@manojsinghnegiwd)
- Twitter (@manojnegiwd)