Skip to content

bap-node-microframework/node-microframework-cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-microframework-cors

Plugin to activate cors support

Installing

To install and add the dependency to the package.json, run the following command:

npm install bap-node-microframework-cors --save

Configuration

To activate cors support with the default options (enable All CORS Requests), write the following code in app/app.ts:

// app/app.ts
...

import { CorsPlugin } from 'bap-node-microframework-cors';

...

import { Kernel } from "./kernel";
var kernel = new Kernel();
var App = new Application(<ApplicationOptions>{
    ...
}, <KernelInterface>kernel);

...

App.registerPlugin(CorsPlugin, {});

...

App.start();

...

You can read the full list of configuration options (here)[https://github.com/expressjs/cors#configuration-options] (at the moment, only origin and credentials are supported).

About

Plugin to activate cors support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published