Skip to content

Instantly share code, notes, and snippets.

@potato4d
Created April 1, 2021 03:18
Show Gist options
  • Save potato4d/99678a06134d65781e820437f7886e69 to your computer and use it in GitHub Desktop.
Save potato4d/99678a06134d65781e820437f7886e69 to your computer and use it in GitHub Desktop.
import express from 'express'
const app = express()
const PORT = ~~(process.env.PORT || 3000)
app.get('/users/stat', (req, res) => {
res.json({
path: '/users/stat',
})
})
app.get('/users/:id', (req, res) => {
res.json({
path: '/users/:id',
userId: req.params.id
})
})
app.listen(PORT, () => {
console.log(`http://localhost:${PORT}`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment