Last active
August 23, 2017 09:41
-
-
Save shunghsiyu/60701b5ddb00298f31fbcf42f60b0fdb to your computer and use it in GitHub Desktop.
Show the query URL
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 app = express() | |
app.get('*', function (req, res) { | |
res.send(`<body style="white-space: pre-wrap" width="100%" height="100%"> | |
You are visiting: ${req.path} | |
You send the following query: | |
${JSON.stringify(req.query, null, 4)} | |
</body> | |
`) | |
}) | |
app.listen(8080, function () { | |
console.log('Listening on port 8080!') | |
}) |
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
{ | |
"name": "urlquery", | |
"version": "0.1.0", | |
"description": "Display the query URL", | |
"main": "app.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"express": "^4.15.4" | |
}, | |
"scripts": { | |
"start": "node app.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment