InternetProgramming/Lab3/node_modules/json-server/lib/server/router/get-full-url.js
2023-12-15 14:42:22 +04:00

10 lines
215 B
JavaScript

"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}`;
};