@staticcms/proxy-server-lite
Version:
Proxy server to be used with Static CMS proxy backend
22 lines • 890 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerCommonMiddlewares = void 0;
const express_1 = __importDefault(require("express"));
const morgan_1 = __importDefault(require("morgan"));
const cors_1 = __importDefault(require("cors"));
function registerCommonMiddlewares(app, options) {
const { logger } = options;
const stream = {
write: (message) => {
logger.debug(String(message).trim());
},
};
app.use((0, morgan_1.default)('combined', { stream }));
app.use((0, cors_1.default)());
app.use(express_1.default.json({ limit: '50mb' }));
}
exports.registerCommonMiddlewares = registerCommonMiddlewares;
//# sourceMappingURL=index.js.map