Created
November 21, 2018 22:07
-
-
Save MBehtemam/ec76758bf767f69e90f838f4678bd152 to your computer and use it in GitHub Desktop.
post method
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
app.post("/", (req, res) => { | |
const { name } = req.body; | |
if (!name || name === undefined) { | |
res.statusCode(400); | |
} | |
res.json({ input: name }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment