@@ -165,19 +165,26 @@ export const setupImageFunction = async ({
165
165
}
166
166
167
167
/**
168
- * Look for extended API routes (background and scheduled functions) and extract the config from the source file.
168
+ * Look for API routes, and extract the config from the source file.
169
169
*/
170
- export const getExtendedApiRouteConfigs = async ( publish : string , baseDir : string ) : Promise < Array < ApiRouteConfig > > => {
170
+ export const getApiRouteConfigs = async ( publish : string , baseDir : string ) : Promise < Array < ApiRouteConfig > > => {
171
171
const pages = await readJSON ( join ( publish , 'server' , 'pages-manifest.json' ) )
172
172
const apiRoutes = Object . keys ( pages ) . filter ( ( page ) => page . startsWith ( '/api/' ) )
173
173
const pagesDir = join ( baseDir , 'pages' )
174
174
175
- const settledApiRoutes = await Promise . all (
175
+ return await Promise . all (
176
176
apiRoutes . map ( async ( apiRoute ) => {
177
177
const filePath = getSourceFileForPage ( apiRoute , pagesDir )
178
178
return { route : apiRoute , config : await extractConfigFromFile ( filePath ) , compiled : pages [ apiRoute ] }
179
179
} ) ,
180
180
)
181
+ }
182
+
183
+ /**
184
+ * Looks for extended API routes (background and scheduled functions) and extract the config from the source file.
185
+ */
186
+ export const getExtendedApiRouteConfigs = async ( publish : string , baseDir : string ) : Promise < Array < ApiRouteConfig > > => {
187
+ const settledApiRoutes = await getApiRouteConfigs ( publish , baseDir )
181
188
182
189
// We only want to return the API routes that are background or scheduled functions
183
190
return settledApiRoutes . filter ( ( apiRoute ) => apiRoute . config . type !== undefined )
0 commit comments