-
-
Save codecademydev/e19e9319ffa85d9332a3f0a6270b2eea to your computer and use it in GitHub Desktop.
Codecademy export
This file contains hidden or 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
| const express = require('express'); | |
| const app = express(); | |
| const PORT = process.env.PORT || 4001; | |
| const soups = ['gazpacho', 'borscht', 'primordial', 'avgolemono', 'laksa']; | |
| app.post('/soups', (req, res, next) => { | |
| const receivedData = req.query.name; | |
| soups.push(receivedData); | |
| res.status(201).send(receivedData); | |
| }) | |
| app.listen(PORT, () => { | |
| console.log(`Server is listening on port ${PORT}`); | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment