Skip to content

Instantly share code, notes, and snippets.

@evangow
Last active December 21, 2020 18:11
Show Gist options
  • Save evangow/8537dbe5fe965a724b6f868ade2db390 to your computer and use it in GitHub Desktop.
Save evangow/8537dbe5fe965a724b6f868ade2db390 to your computer and use it in GitHub Desktop.
//npm modules
const express = require('express');
const uuid = require('uuid').v4

// create the server
const app = express();

// create the homepage route at '/'
app.get('/', (req, res) => {
  console.log(req)
  const uniqueId = uuid()
  res.send(`Hit home page. Received the unique id: ${uniqueId}\n`)
})

// tell the server what port to listen on
app.listen(3000, () => {
  console.log('Listening on localhost:3000')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment