Skip to content

Instantly share code, notes, and snippets.

@mokshchaudhary
Last active November 17, 2022 09:20
Show Gist options
  • Save mokshchaudhary/b11cec107be0344e613a9d6eba7016d2 to your computer and use it in GitHub Desktop.
Save mokshchaudhary/b11cec107be0344e613a9d6eba7016d2 to your computer and use it in GitHub Desktop.
Simple Express Server
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