Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  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!`))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement