Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default async function() {
const sw = swTemplate({foo: 'bar'});
const app = new App('element', el => el);
app.middleware((ctx, next) => {
if (ctx.url === '/sw.js') {
ctx.body = sw;
}
return next();
});
return app;
}