internet-programming/lab3/node_modules/json-server/lib/server/router/get-full-url.js

10 lines
215 B
JavaScript
Raw Normal View History

2023-11-02 02:38:40 +04:00
"use strict";
const url = require('url');
module.exports = function getFullURL(req) {
const root = url.format({
protocol: req.protocol,
host: req.get('host')
});
return `${root}${req.originalUrl}`;
};