Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Created August 28, 2019 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsh-code/8b4da2ca06ba1ae288ee74d78b44cb26 to your computer and use it in GitHub Desktop.
Save tsh-code/8b4da2ca06ba1ae288ee74d78b44cb26 to your computer and use it in GitHub Desktop.
const express = require('express')
const app = express()
const port = 3055
app.get('/async', async (req, res) => {
const user = await readUserAsync()
res.send(user)
})
app.get('/sync', (req, res) => {
const user = readUserSync()
res.send(user)
})
app.listen(port, () => console.log(`Example app listening on port ${port}!`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment