Created
April 1, 2021 03:18
-
-
Save potato4d/99678a06134d65781e820437f7886e69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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