vados-cors
v3.0.1
Published
Cross-Origin Resource Sharing(CORS) for vados
Downloads
1
Readme
vados-cors
Cross-Origin Resource Sharing(CORS) for vados A plugin helps to resolve cross domain for XHR request
Install
npm i vados-cors -S
Examples
Typescript
import { Server } from 'vados';
import { route } from 'vados-route';
import { serve } from 'vados-serve';
import { cors } from 'vados-cors';
Server.use(serve({
'/upload': path.join(__dirname, '..', 'assets', 'upload')
}));
Server.use(cors());
Server.use(route(path.join(__dirname, 'controller')));
Javascript
const vados = require("vados");
const vadosRoute = require("vados-route");
const vadosServe = require("vados-serve");
const vadosCors = require("vados-cors");
vados.Server.use(vadosServe.serve({
'/images': path.join(__dirname, 'path to folder which contains resource files'),
'/files': path.join(__dirname, 'path to folder which contains resource files'),
}));
vados.Server.use(vadosCors.cors());
vados.Server.use(vadosRoute.route(path.join(__dirname, 'controller')));