Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
koa-mount-html
Advanced tools
Mount all GET requests for text/html content types to a given KOA application
Catch-all mounting of koa apps and middleware for HTML GET requests.
$ npm install koa-mount-html
const koa = require('koa');
const mountHtml = require('koa-mount-html');
const serve = require('koa-static');
const app = koa();
// with `defer: true`, koa-mount-html will only catch requests that are not
// answered by other middleware
app.use(mountHtml(function *sendHtml() {
yield send(this, '/index.html', { root: __dirname + '/public' });
}, { defer: true }));
app.use(serve('public/static_pages'));
const koa = require('koa');
const mountHtml = require('koa-mount-html');
const webpackConfig = require('./webpack.conf');
const compiler = webpack(webpackConfig);
const publicPath = webpackConfig.output.publicPath;
const app = koa();
app.use(mountHtml(
rewrite('/*', publicPath + '/index.html')
));
app.use(mount(
publicPath, webpackDevMiddleware(compiler, serverOptions)
));
defer
If true, serves after yield next, allowing any downstream middleware to respond first.includeDotPaths
If true, then paths including a dot (i.e. '/staticPage.html') will be cought as well.FAQs
Mount all GET requests for text/html content types to a given KOA application
We found that koa-mount-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.