Created
October 17, 2020 06:16
-
-
Save miladr0/56ef6a23867549b8f7c0143e75c43881 to your computer and use it in GitHub Desktop.
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
import express from 'express'; | |
const app = express(); | |
// respond with "hello world" when a GET request is made to the homepage | |
app.get('/', (req, res) => { | |
res.send('hello world'); | |
}); | |
app.get('/api-1', (req, res) => { | |
res.send('you hit api-1'); | |
}); | |
app.get('/api-2', (req, res) => { | |
res.send('you hit api-2'); | |
}); | |
app.listen(3000, () => console.log('server listening on port 3000!')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment