@leafage/server
Version:
The React Server Side Render Framework
28 lines (26 loc) • 600 B
JavaScript
/**
* @leafage/server v1.3.2
*
* Copyright (c) Leafage.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
var devPreset = function devPreset(ctx) {
var devMiddleware = null;
if (ctx.context.options.dev) {
ctx.context.hook('bundle:devMiddleware', function (middleware) {
devMiddleware = middleware;
});
}
ctx.app.use(function (req, res, next) {
if (devMiddleware) {
devMiddleware(req, res, next);
return;
}
next();
});
};
export { devPreset };