ecklf-tmp-runtime-test
Advanced tools
Comparing version 1.0.129 to 1.0.130
@@ -34,2 +34,3 @@ "use strict"; | ||
const PATH = (0, utils_1.assertEnv)('PATH'); | ||
const VERCEL_RUST_EXPERIMENTAL_ROUTE_MERGE = process.env.VERCEL_RUST_EXPERIMENTAL_ROUTE_MERGE === 'true'; | ||
const rustEnv = { | ||
@@ -70,40 +71,12 @@ PATH: `${node_path_1.default.join(HOME, '.cargo/bin')}:${PATH}`, | ||
}); | ||
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)); | ||
if (VERCEL_RUST_EXPERIMENTAL_ROUTE_MERGE) { | ||
const handlerFiles = yield (0, build_utils_1.glob)('api/**/*.rs', workPath); | ||
const routes = (0, routes_1.generateRoutes)(Object.keys(handlerFiles)); | ||
return { | ||
output: lambda, | ||
routes, | ||
}; | ||
} | ||
return { | ||
output: lambda, | ||
// 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', */ | ||
/* }, */ | ||
/* ], */ | ||
}; | ||
@@ -134,4 +107,3 @@ }); | ||
shouldServe: (options) => __awaiter(void 0, void 0, void 0, function* () { | ||
// TODO | ||
/* debug(`Requested ${options.requestPath} for ${options.entrypoint}`); */ | ||
(0, build_utils_1.debug)(`Requested ${options.requestPath} for ${options.entrypoint}`); | ||
/* return Promise.resolve(options.requestPath === options.entrypoint); */ | ||
@@ -138,0 +110,0 @@ return Promise.resolve(options.entrypoint.startsWith('api/')); |
{ | ||
"name": "ecklf-tmp-runtime-test", | ||
"version": "1.0.129", | ||
"version": "1.0.130", | ||
"description": "Rust runtime for Vercel Functions.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/vercel-community/rust", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
24916
420
5