How to setup cors
ShareinSK opened this issue · 1 comments
ShareinSK commented
Hi,
Where should I setup the cors
option?
Thanks
OskarLebuda commented
@ShareinSK you have to install cors
from npm
npm install --save cors
after that you should add use
to app.ts
in $onMountingMiddlewares()
hook
public async $onMountingMiddlewares(): Promise<any> {
this
.use(GlobalAcceptMimesMiddleware)
.use(cors({
origin: '*'
}));
return null;
}