
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
This is a [Grunt](http://gruntjs.com/) task for running a [Koa](http://koajs.com/) web server.
This is a Grunt task for running a Koa web server.
Requires NodeJS v0.12.0 or greater. NodeJS 4 recommended.
npm install grunt-koa --save-dev
Example of serving static content. This is useful if you just want to serve a set of static files from a build directory at the end of your grunt build. This example serves content from the static/ directory.
grunt.initConfig({
koa: {
serve: {
options: {
static: 'static'
}
}
}
});
grunt.loadNpmTasks('grunt-koa');
grunt.registerTask('default', ['koa:serve']);
Example of custom middleware. This is useful when you want to run a Koa server with a set of middleware installed.
var sampleMiddleware = function *(next) {
grunt.log.writeln('sample middleware');
yield next;
};
grunt.initConfig({
koa: {
serve: {
options: {
middleware: [sampleMiddleware]
}
}
}
});
grunt.loadNpmTasks('grunt-koa');
grunt.registerTask('default', ['koa:serve']);
Specifies the port to run Koa on.
A path to serve static files from, relative to where Grunt is executed. If this option is specified, then the koa-static middleware will automatically be installed and set to serve static files using this option as the path.
If this options is used to install middleware(s) into Koa. It should be set to an array of middleware functions, or a function which will be called with a reference to the Koa application. If this is set to a function, it should take the form function (koaApplication) {} and should register middleware on the passed in Koa application object. For example, these two configurations would be functionally the same:
grunt.initConfig({
koa: {
serve: {
options: {
middleware: [someMiddleware, moreMiddleware];
}
}
}
});
grunt.initConfig({
koa: {
serve: {
options: {
middleware: function(koaApplication) {
koaApplication.use(someMiddleware);
koaApplication.use(moreMiddleware);
}
}
}
}
});
Not Yet Implemented. Coming Soon! If enabled, the koa-livereload middleware will be automatically loaded.
FAQs
This is a [Grunt](http://gruntjs.com/) task for running a [Koa](http://koajs.com/) web server.
The npm package grunt-koa receives a total of 2 weekly downloads. As such, grunt-koa popularity was classified as not popular.
We found that grunt-koa 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.