Last active
November 17, 2022 09:20
-
-
Save mokshchaudhary/b11cec107be0344e613a9d6eba7016d2 to your computer and use it in GitHub Desktop.
Simple Express Server
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 = 80 | |
app.get('/', (req, res) => { | |
res.send('India has won the match') | |
}) | |
app.post('/', (req, res) => { | |
res.send('Post /') | |
}) | |
app.get('/admin', (req, res) => { | |
res.send('Get /admin') | |
}) | |
app.post('/', (req, res) => { | |
res.send('Post /admin') | |
}) | |
app.get('/admin/moksh', (req, res) => { | |
res.send('Get /admin/moksh') | |
}) | |
app.get('/admin/moksh', (req, res) => { | |
res.send('Get /admin/shivam') | |
}) | |
app.listen(port, () => { | |
console.log(`Example app listening on port ${port}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment