Answers for "router route"

49

express js example

//to run : node filename.js
const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))

//visit localhost:3000
// assuming you have done 1) npm init 2) npm install express
Posted by: Guest on July-17-2020
0

router

app.get('/', function (req, res) {
  res.send('Hello World!')
})
Posted by: Guest on May-11-2021
0

router

// wiki.js - Wiki route module.

var express = require('express');
var router = express.Router();

// Home page route.
router.get('/', function (req, res) {
  res.send('Wiki home page');
})

// About page route.
router.get('/about', function (req, res) {
  res.send('About this wiki');
})

module.exports = router;
Posted by: Guest on May-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language