mirror of
https://github.com/typicode/json-server.git
synced 2025-08-01 06:34:02 +08:00
11 lines
199 B
JavaScript
11 lines
199 B
JavaScript
const url = require('url')
|
|
|
|
module.exports = function getFullURL(req) {
|
|
const root = url.format({
|
|
protocol: req.protocol,
|
|
host: req.get('host')
|
|
})
|
|
|
|
return `${root}${req.originalUrl}`
|
|
}
|