@whook/example
Version:
A basic Whook server
24 lines (16 loc) • 631 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _knifecycle = require("knifecycle");
var _cors = require("@whook/cors");
var _authorization = require("@whook/authorization");
var _default = (0, _knifecycle.service)(initWrappers, 'WRAPPERS'); // Wrappers are allowing you to override every
// handlers of your API with specific behaviors,
// here we add CORS and HTTP authorization support
exports.default = _default;
async function initWrappers() {
const WRAPPERS = [_cors.wrapHandlerWithCORS, _authorization.wrapHandlerWithAuthorization];
return WRAPPERS;
}