@jsonjoy.com/reactive-rpc
Version:
Reactive-RPC is a library for building reactive APIs over WebSocket, HTTP, and other RPCs.
18 lines • 791 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.enableCors = void 0;
const enableCors = (uws) => {
const AccessControlAllowOrigin = Buffer.from('Access-Control-Allow-Origin');
const AccessControlAllowOriginAllowAll = Buffer.from('*');
const AccessControlAllowCredentials = Buffer.from('Access-Control-Allow-Credentials');
const AccessControlAllowCredentialsTrue = Buffer.from('true');
uws.options('/*', (res) => {
res.cork(() => {
res.writeHeader(AccessControlAllowOrigin, AccessControlAllowOriginAllowAll);
res.writeHeader(AccessControlAllowCredentials, AccessControlAllowCredentialsTrue);
res.end();
});
});
};
exports.enableCors = enableCors;
//# sourceMappingURL=util.js.map
;