Created
June 27, 2025 07:44
-
-
Save deer-roy/0c67526a576ab78740052bb69c42c8d3 to your computer and use it in GitHub Desktop.
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 cors = require('cors') | |
const express = require('express'); | |
const { json, urlencoded } = require('express'); | |
const { path } = require('fs') | |
const app = express() | |
const port = 8080 | |
app.use(cors()) | |
app.use(json()) // for parsing application/json | |
app.use(urlencoded({ extended: true })) // for parsing application/x-www-form-urlencoded | |
app.all('/', (req, res) => { | |
console.log('post body =>', req.body) | |
console.log('query =>', req.query) | |
console.log('headers =>', req.headers) | |
}) | |
function onServe() { | |
console.log(`Example app listening on port ${port}`) | |
} | |
//serve without https | |
app.listen(port, onServe) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment