UNPKG

@appsemble/node-utils

Version:

NodeJS utilities used by Appsemble internally.

10 lines 418 B
import { assertKoaCondition } from '@appsemble/node-utils'; export function createCssHandler(type, { getAppStyles }) { return async (ctx) => { const app = await getAppStyles({ context: ctx, query: { attributes: [type], raw: true } }); assertKoaCondition(app != null, ctx, 404, 'App not found'); ctx.body = app[type]; ctx.type = 'css'; }; } //# sourceMappingURL=cssHandler.js.map