How to use koa-csp - 2 common examples

To help you get started, we’ve selected a few koa-csp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Val-istar-Guo / mili / server / server.js View on Github external
import path from 'path';

import Koa from 'koa';
import csp from 'koa-csp';
import logger from 'koa-logger';

// middleware config
import * as config from './config';
import router from './routes';


const server = new Koa();

server
  .use(logger())
  .use(csp(config.csp))
  .use(router.routes());

export default server;
github Val-istar-Guo / mili / template / web / server / server.js View on Github external
import path from 'path';

import Koa from 'koa';
import csp from 'koa-csp';
import logger from 'koa-logger';

// middleware config
import * as config from './config';
import router from './routes';


const server = new Koa();

server
  .use(logger())
  .use(csp(config.csp))
  .use(router.routes());

export default server;

koa-csp

Used to set respose header: Content-Security-Policy

MIT
Latest version published 2 months ago

Package Health Score

68 / 100
Full package analysis

Popular koa-csp functions