Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. const express = require('express')
  2. const app = express()
  3.  
  4. const stringifedJson = JSON.stringify({a:1})
  5.  
  6. app.get('/cached', (req,res)=>{
  7. res.setHeader('Content-Type', 'application/json');
  8. res.end(stringifedJson)
  9. })
  10. app.listen(3000, ()=>console.log('Server started'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement