Skip to content

Commit c11f4f3

Browse files
committed
feat: add support for edge key
1 parent 8fef522 commit c11f4f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/runtime/src/helpers/analysis.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const enum ApiRouteType {
1111

1212
export interface ApiStandardConfig {
1313
type?: never
14-
runtime?: 'nodejs' | 'experimental-edge'
14+
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
1515
schedule?: never
1616
}
1717

@@ -39,7 +39,7 @@ export const validateConfigValue = (config: ApiConfig, apiFilePath: string): con
3939
)
4040
return false
4141
}
42-
if ((config as ApiConfig).runtime === 'experimental-edge') {
42+
if ((config as ApiConfig).runtime === 'experimental-edge' || (config as ApiConfig).runtime === 'edge') {
4343
console.error(
4444
`Invalid config value in ${relative(
4545
process.cwd(),
@@ -60,7 +60,7 @@ export const validateConfigValue = (config: ApiConfig, apiFilePath: string): con
6060
)
6161
return false
6262
}
63-
if (config.type && (config as ApiConfig).runtime === 'experimental-edge') {
63+
if (config.type && ((config as ApiConfig).runtime === 'experimental-edge' || (config as ApiConfig).runtime === 'edge')) {
6464
console.error(
6565
`Invalid config value in ${relative(
6666
process.cwd(),

packages/runtime/src/helpers/functions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const generateFunctions = async (
4343

4444
for (const { route, config, compiled } of apiRoutes) {
4545
// Don't write a lambda if the runtime is edge
46-
if (config.runtime === 'experimental-edge') {
46+
if (config.runtime === 'experimental-edge' || config.runtime === 'edge') {
4747
continue
4848
}
4949
const apiHandlerSource = await getApiHandler({

0 commit comments

Comments
 (0)