Guest User

Untitled

a guest
Oct 21st, 2019
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const express = require('express')
  2. const app = express()
  3.  
  4. app.get('/en', function (req, res) {
  5. res.send('Hello World!')
  6. })
  7.  
  8.  
  9. app.get('/fi', function (req, res) {
  10. res.send('Terve maailma!')
  11. })
  12.  
  13.  
  14. app.use(function (req, res, next) {
  15. console.log("Requested " + req.path + " " + req.originalUrl)
  16. res.status(404).send("Sorry can't find that! Requested " + req.path + " " + req.originalUrl + req.)
  17. })
  18.  
  19. app.listen(process.env.PORT, () =>
  20. console.log(`Listening on port 5000!`))
RAW Paste Data