Advertisement
Guest User

Untitled

a guest
May 26th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. const express = require('express')
  2. const bodyParser = require('body-parser')
  3. const cors = require('cors')
  4. const app = express()
  5. const apiPort = 3000
  6.  
  7. app.use(bodyParser.urlencoded({ extended: true }))
  8. app.use(cors())
  9. app.use(bodyParser.json())
  10.  
  11. app.get('/', (req, res) => {
  12. res.send('Hello World!')
  13. })
  14.  
  15. app.listen(apiPort, () => console.log(`Server running on port ${apiPort}`))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement