Skip to content

Instantly share code, notes, and snippets.

@kuhel
Created September 25, 2017 16:46
Show Gist options
  • Save kuhel/e263bdaff3e431b792a0d741dd533bb3 to your computer and use it in GitHub Desktop.
Save kuhel/e263bdaff3e431b792a0d741dd533bb3 to your computer and use it in GitHub Desktop.
const fs = require('fs');
const request = require('request');
fs.readFile('./config.json', 'utf-8', (err, data) => {
if (err) {
throw new Error(err);
}
request('http://www.google.com', (error, response, body) => {
console.log('statusCode:', response.statusCode); // Print the response status code if a response was received
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment