Advertisement
Mr-roz3r

baca-file.js

Oct 30th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. var fs = require('fs');
  2. var http = require('http');
  3.  
  4. http.createServer(function(req,res){
  5. fs.readFile('index.html', (err, data) => {
  6. if (err) throw err;
  7.  
  8. res.writeHead(200, {'Content-Type' : 'text-html'});
  9. res.write(data);
  10. res.end();
  11. })
  12. }).listen(8000);
  13. console.log('server running on localhost:8000');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement