hinos-cors
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

hinos-cors

Cross-Origin Resource Sharing(CORS) for hinos A plugin help resolve cross domain for XHR request

Install

npm i hinos-cors -S

Examples

Typescript

import { Server } from 'hinos';
import { route } from 'hinos-route';
import { serve } from 'hinos-serve';
import { cors } from 'hinos-cors';

Server.use(serve({
    '/upload': path.join(__dirname, '..', 'assets', 'upload')
}));
Server.use(cors());
Server.use(route(path.join(__dirname, 'controller')));

Javascript

const hinos = require("hinos");
const hinosRoute = require("hinos-route");
const hinosServe = require("hinos-serve");
const hinosCors = require("hinos-cors");

hinos.Server.use(hinosServe.serve({
    '/images': path.join(__dirname, 'path to folder which contains resource files'),
    '/files': path.join(__dirname, 'path to folder which contains resource files'),
}));
hinos.Server.use(hinosCors.cors());
hinos.Server.use(hinosRoute.route(path.join(__dirname, 'controller')));

Readme

Keywords

none

Package Sidebar

Install

npm i hinos-cors

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • doanthuanthanh88