next-rest-framework
Version:
Next REST Framework - write type-safe, self-documenting REST APIs in Next.js
19 lines (18 loc) • 903 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NextRestFramework = void 0;
const define_route_1 = require("./define-route");
const utils_1 = require("./utils");
const define_api_route_1 = require("./define-api-route");
const define_catch_all_route_1 = require("./define-catch-all-route");
const define_catch_all_api_route_1 = require("./define-catch-all-api-route");
const NextRestFramework = (_config) => {
const config = (0, utils_1.getConfig)(_config);
return {
defineCatchAllRoute: (0, define_catch_all_route_1.defineCatchAllRoute)({ config }),
defineCatchAllApiRoute: (0, define_catch_all_api_route_1.defineCatchAllApiRoute)({ config }),
defineRoute: (0, define_route_1.defineRoute)({ config }),
defineApiRoute: (0, define_api_route_1.defineApiRoute)({ config })
};
};
exports.NextRestFramework = NextRestFramework;