Created
February 7, 2021 04:08
-
-
Save briansunter/0322aa7188cde65304041540715be615 to your computer and use it in GitHub Desktop.
express-hello.js
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(); | |
app.get('/', (req, res) => { | |
return res.send('Received a GET HTTP method'); | |
}); | |
app.post('/', (req, res) => { | |
return res.send('Received a POST HTTP method'); | |
}); | |
app.put('/', (req, res) => { | |
return res.send('Received a PUT HTTP method'); | |
}); | |
app.delete('/', (req, res) => { | |
return res.send('Received a DELETE HTTP method'); | |
}); | |
app.listen(3000, () => | |
console.log(`Example app listening on port ${process.env.PORT}!`), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment