A Style Guide Generator - using NodeJS and Puppeteer, an API to control Chrome. See it live at http://stylifyme.com
This repo only contains the web service.
We host our app on Heroku, using the 2 buildpacks below:
heroku buildpacks:add heroku/google-chrome
heroku buildpacks:add heroku/nodejs
- Make sure you have NodeJS installed and running
- Install dependencies with npm
npm install
- Update the referrer urls in
/src/config.mjs
with the urls of your frontend (local and production): - Start the nodeJs app with
npm run start
(ornode app.mjs
) - Query
http://localhost:5000/query?url=https%3A%2F%2Fgoogle.com
(assuming you run your app on port5000
) and you should be able to see a JSON response I recommend using Postman for debugging your api
This repo only contains the web service, you can query it from the front end like this:
var urlToQuery = encodeURIComponent("http://google.com");
$.ajax({
dataType: "jsonp",
url: "http://youreServiceUrl.com/query?url="+ urlToQuery,
success: function(data){
if(data["error"]){
alert("Error: " + data["error"]);
return;
}
//PROCESS the result
},
timeout : 10000
}).fail(function(){
alert("Could not query site, the service might be down, please try again later.");
});