Created
October 24, 2018 17:38
-
-
Save kharandziuk/4f4939791b6e873a5f82e9a743007629 to your computer and use it in GitHub Desktop.
simple server with people enpoing
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
var debug = require('debug')('app') | |
const express = require('express') | |
const app = express() | |
const port = 3000 | |
app.use(express.json()) | |
app.post('/people', (req, res) => { | |
debug('call') | |
setTimeout( | |
() => res.status(201).json({status: 'created'}), | |
2000 | |
) | |
}) | |
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