ecklf-tmp-runtime-test
Advanced tools
Comparing version 1.0.117 to 1.0.118
@@ -22,2 +22,3 @@ "use strict"; | ||
const utils_1 = require("./lib/utils"); | ||
const routes_1 = require("./lib/routes"); | ||
function buildHandler(options) { | ||
@@ -69,14 +70,40 @@ var _a; | ||
}); | ||
const handlerFiles = yield (0, build_utils_1.glob)('api/**/*.rs', workPath); | ||
const routes = (0, routes_1.generateRoutes)(Object.keys(handlerFiles)); | ||
(0, build_utils_1.debug)(JSON.stringify(routes, null, 2)); | ||
return { | ||
output: lambda, | ||
routes: [ | ||
{ | ||
src: '/api/foo', | ||
dest: '/api/index', | ||
}, | ||
{ | ||
src: '/api/bar/baz', | ||
dest: '/api/index', | ||
}, | ||
], | ||
// Dynamic routes | ||
// \/product\/(?<id>[^\/]+) | ||
// Catch all routes | ||
// \/product\/(\S+) | ||
// Optional catch all | ||
// \/product(\/\S+)? | ||
routes, | ||
/* routes: [ */ | ||
/* { */ | ||
/* src: '/api/foo', */ | ||
/* dest: '/api/index', */ | ||
/* }, */ | ||
/* { */ | ||
/* src: '/api/bar/baz', */ | ||
/* dest: '/api/index', */ | ||
/* }, */ | ||
/* { */ | ||
/* src: '/api/dynamic/(?<path>[^/]+)', */ | ||
/* dest: '/api/index?path=$path', */ | ||
/* }, */ | ||
/* { */ | ||
/* src: '/api/all/(\\S+)', */ | ||
/* dest: '/api/index', */ | ||
/* }, */ | ||
/* { */ | ||
/* src: '/api/optional/(/\\S+)?', */ | ||
/* dest: '/api/index', */ | ||
/* }, */ | ||
/* { */ | ||
/* src: '/api/(\\S+)', */ | ||
/* dest: '/api/index', */ | ||
/* }, */ | ||
/* ], */ | ||
}; | ||
@@ -107,6 +134,7 @@ }); | ||
shouldServe: (options) => __awaiter(void 0, void 0, void 0, function* () { | ||
(0, build_utils_1.debug)(`Serve: ${JSON.stringify(options)}`); | ||
return Promise.resolve(options.requestPath === options.entrypoint); | ||
/* debug(`Requested ${options.requestPath} for ${options.entrypoint}`); */ | ||
/* return Promise.resolve(options.requestPath === options.entrypoint); */ | ||
return Promise.resolve(options.entrypoint.startsWith('api/')); | ||
}), | ||
}; | ||
exports.version = runtime.version, exports.build = runtime.build, exports.prepareCache = runtime.prepareCache, exports.shouldServe = runtime.shouldServe; |
{ | ||
"name": "ecklf-tmp-runtime-test", | ||
"version": "1.0.117", | ||
"version": "1.0.118", | ||
"description": "Rust runtime for Vercel Functions.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/vercel-community/rust", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23802
10
385