Guest User

Untitled

a guest
Jun 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const express = require('express')
  2. const app = express()
  3.  
  4. const PORT = process.env.PORT || 4000
  5.  
  6. app.get('/', (req, res) => {
  7. res.json({
  8. message: 'OK'
  9. })
  10. })
  11.  
  12. app.get('*', (req, res) => {
  13. res.json({
  14. message: 'Error'
  15. })
  16. })
  17.  
  18. app.listen(PORT, () => {
  19. console.log(`Server is listening on ${PORT}`)
  20. })
Add Comment
Please, Sign In to add comment