Skip to content

Instantly share code, notes, and snippets.

@miladr0
Created October 17, 2020 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miladr0/56ef6a23867549b8f7c0143e75c43881 to your computer and use it in GitHub Desktop.
Save miladr0/56ef6a23867549b8f7c0143e75c43881 to your computer and use it in GitHub Desktop.
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