Created
June 20, 2020 09:58
-
-
Save fredriccliver/c03d44c3083a02735bbf8a606d1cd5fd to your computer and use it in GitHub Desktop.
http request and read practice
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 port = 3000 | |
const bodyParser = require('body-parser') | |
const app = express() | |
app.use(bodyParser.urlencoded({ extended: true })) | |
app.get('/', (req, res) => { | |
res.send("hello") | |
}) | |
app.post('/', (req, res) => { | |
res.send('hello on post call') | |
}) | |
app.listen(port, () => { | |
console.log(`Node is listening on port ${port}`); | |
console.log(`go to http://localhost:${port}`) | |
}) | |
const caller = require('./src/caller') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment