Description
Hi.
I'm trying to use this odata-v4-server as a service with sap open ui5 framework in couple. Using @odata.cors don't satisfy requirements of open ui5 because they actively using "options" request for pre-flight check. In this case i enhance static create
method of class ODataServerBase
to support pre-flight conditions in this way
....
if (server.cors) {
var corsOpt = {
origin: ['http://localhost:8080', 'http://localhost'],
optionsSuccessStatus: 204,
exposedHeaders: ['OData-Version']
}
router.options('*', cors(corsOpt))
router.use(cors(corsOpt));
}
May be exists another way, supported by this odata-v4-server api? Using a router class as optional parameter of create method can be is alternative solution.
P.S. using router instance, that returned by create method(without port parameter request) has no effect. If reffer to documentation of npm cors package, using pre-flight conditions have to declare before any router definition in express instance.