SHARE
TWEET

Untitled

a guest Dec 5th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var http = require('http');
  2. const server = http.createServer().listen(8080);
  3. server.on('request', (request, response) => {
  4.     const { method, url } = request;
  5.     const { headers } = request;
  6. const userAgent = headers['user-agent'];
  7.   console.log(method)
  8.   console.log(url);
  9.   console.log(headers);
  10.   console.log(userAgent);
  11.   response.write(JSON.stringify())
  12. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top