@@ -165,19 +165,26 @@ export const setupImageFunction = async ({
165165}
166166
167167/**
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.
169169 */
170- export const getExtendedApiRouteConfigs = async ( publish : string , baseDir : string ) : Promise < Array < ApiRouteConfig > > => {
170+ export const getApiRouteConfigs = async ( publish : string , baseDir : string ) : Promise < Array < ApiRouteConfig > > => {
171171 const pages = await readJSON ( join ( publish , 'server' , 'pages-manifest.json' ) )
172172 const apiRoutes = Object . keys ( pages ) . filter ( ( page ) => page . startsWith ( '/api/' ) )
173173 const pagesDir = join ( baseDir , 'pages' )
174174
175- const settledApiRoutes = await Promise . all (
175+ return await Promise . all (
176176 apiRoutes . map ( async ( apiRoute ) => {
177177 const filePath = getSourceFileForPage ( apiRoute , pagesDir )
178178 return { route : apiRoute , config : await extractConfigFromFile ( filePath ) , compiled : pages [ apiRoute ] }
179179 } ) ,
180180 )
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 )
181188
182189 // We only want to return the API routes that are background or scheduled functions
183190 return settledApiRoutes . filter ( ( apiRoute ) => apiRoute . config . type !== undefined )
0 commit comments