five-server
Version:
Development Server with Live Reload Capability. (Maintained Fork of Live Server)
20 lines • 615 B
JavaScript
;
/**
* @author Yannick Deubel (https://github.com/yandeu)
* @copyright Copyright (c) 2021 Yannick Deubel
* @license {@link https://github.com/yandeu/five-server/blob/main/LICENSE LICENSE}
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.fallbackFile = void 0;
const fallbackFile = (handler, file) => {
if (!file)
return (req, res, next) => {
next();
};
return (req, res, next) => {
req.url = `/${file}`;
handler(req, res, next);
};
};
exports.fallbackFile = fallbackFile;
//# sourceMappingURL=fallbackFile.js.map