Skip to content

Instantly share code, notes, and snippets.

@margielm
Created April 26, 2021 14:04
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 margielm/31e2bc54ca460fdb51283246b36bd0f7 to your computer and use it in GitHub Desktop.
Save margielm/31e2bc54ca460fdb51283246b36bd0f7 to your computer and use it in GitHub Desktop.
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello Express!')
})
app.post('/api/users/logon', (req, res) => {
console.log('Login post!')
res.send()
})
app.get('/api/users/logon', (req, res) => {
console.log('Login get !')
res.send('login get')
})
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})
{
"name": "mock",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start":"node index.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"express": "^4.17.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment