venables / Koa Helmet
Licence: mit
Important security headers for koa
Stars: ✭ 595
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Koa Helmet
Koatty
Koa2 + Typescript = Koatty. Use Typescript's decorator implement IOC and AOP.
Stars: ✭ 67 (-88.74%)
Mutual labels: middleware, koa, koa2
koa-plus
The Koa framework extended for APIs. Optimized for security, scalability, and productivity.
Stars: ✭ 17 (-97.14%)
Mutual labels: koa, secure, secure-by-default
doa
A middleware framework for Deno's http serve🦕. Transplanted from Koa with ❤️
Stars: ✭ 20 (-96.64%)
Mutual labels: middleware, koa
koa2-winston
koa2 version winston logger like express-winston
Stars: ✭ 37 (-93.78%)
Mutual labels: koa, koa2
stats
📊 Request statistics middleware that stores response times, status code counts, etc
Stars: ✭ 15 (-97.48%)
Mutual labels: middleware, koa
Egg
🥚 Born to build better enterprise frameworks and apps with Node.js & Koa
Stars: ✭ 17,616 (+2860.67%)
Mutual labels: koa, koa2
Agile-Server
A simple, fast, complete Node.js server solution, based on KOA. 简单快速的 、性能强劲的、功能齐全的 node 服务器解决方案合集,基于 KOA。
Stars: ✭ 24 (-95.97%)
Mutual labels: koa, koa2
Koahub
KoaHub.js -- 中文最佳实践Node.js Web快速开发框架。支持Koa.js, Express.js中间件。当前项目已停止维护,推荐使用Doodoo.js
Stars: ✭ 308 (-48.24%)
Mutual labels: koa, koa2
Koa Rest Api Boilerplate
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
Stars: ✭ 420 (-29.41%)
Mutual labels: koa, koa2
koa-waterline
Deprecated: A middleware for your hose
Stars: ✭ 14 (-97.65%)
Mutual labels: middleware, koa
Concurrency Logger
Log HTTP requests/responses separately, visualize their concurrency and report logs/errors in context of a request.
Stars: ✭ 400 (-32.77%)
Mutual labels: middleware, koa
Airship
Secure Content Management for the Modern Web - "The sky is only the beginning"
Stars: ✭ 422 (-29.08%)
Mutual labels: secure, secure-by-default
koa-helmet
koa-helmet is a wrapper for helmet to work with koa. It provides important security headers to make your app more secure by default.
Installation
npm i koa-helmet
# or:
yarn add koa-helmet
Usage
Usage is the same as helmet
Helmet offers 11 security middleware functions:
// This...
app.use(helmet());
// ...is equivalent to this:
app.use(helmet.contentSecurityPolicy());
app.use(helmet.dnsPrefetchControl());
app.use(helmet.expectCt());
app.use(helmet.frameguard());
app.use(helmet.hidePoweredBy());
app.use(helmet.hsts());
app.use(helmet.ieNoOpen());
app.use(helmet.noSniff());
app.use(helmet.permittedCrossDomainPolicies());
app.use(helmet.referrerPolicy());
app.use(helmet.xssFilter());
You can see more in the documentation.
Example
import Koa from 'koa';
import helmet from 'koa-helmet';
const app = new Koa();
app.use(helmet());
app.use((ctx) => {
ctx.body = "Hello World"
});
app.listen(4000);
Testing
To run the tests, simply run
npm test
Versioning
- koa-helmet >=2.x (master branch) supports koa 2.x
- koa-helmet 1.x (koa-1 branch) supports koa 0.x and koa 1.x
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].