Created
April 26, 2021 14:04
-
-
Save margielm/31e2bc54ca460fdb51283246b36bd0f7 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
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}`) | |
}) |
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
{ | |
"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