@@ -4,7 +4,6 @@ import type { Bridge as NodeBridge } from '@vercel/node-bridge/bridge'
44import { outdent as javascript } from 'outdent'
55
66import type { NextConfig } from '../helpers/config'
7- import { splitApiRoutes as isSplitApiRoutesEnabled } from '../helpers/flags'
87
98import type { NextServerType } from './handlerUtils'
109import type { NetlifyNextServerType } from './server'
@@ -31,11 +30,10 @@ type MakeApiHandlerParams = {
3130 app : string
3231 pageRoot : string
3332 NextServer : NextServerType
34- splitApiRoutes : boolean
3533}
3634
3735// We return a function and then call `toString()` on it to serialise it as the launcher function
38- const makeApiHandler = ( { conf, app, pageRoot, NextServer, splitApiRoutes } : MakeApiHandlerParams ) => {
36+ const makeApiHandler = ( { conf, app, pageRoot, NextServer } : MakeApiHandlerParams ) => {
3937 // Change working directory into the site root, unless using Nx, which moves the
4038 // dist directory and handles this itself
4139 const dir = path . resolve ( __dirname , app )
@@ -90,7 +88,6 @@ const makeApiHandler = ({ conf, app, pageRoot, NextServer, splitApiRoutes }: Mak
9088 } ,
9189 {
9290 revalidateToken : customContext ?. odb_refresh_hooks ,
93- splitApiRoutes,
9491 } ,
9592 )
9693 const requestHandler = nextServer . getRequestHandler ( )
@@ -137,13 +134,11 @@ export const getApiHandler = ({
137134 publishDir = '../../../.next' ,
138135 appDir = '../../..' ,
139136 nextServerModuleRelativeLocation,
140- featureFlags,
141137} : {
142138 schedule ?: string
143139 publishDir ?: string
144140 appDir ?: string
145141 nextServerModuleRelativeLocation : string | undefined
146- featureFlags : Record < string , unknown >
147142} ) : string =>
148143 // This is a string, but if you have the right editor plugin it should format as js (e.g. bierner.comment-tagged-templates in VS Code)
149144 javascript /* javascript */ `
@@ -166,8 +161,6 @@ export const getApiHandler = ({
166161 let staticManifest
167162 const path = require ( "path" ) ;
168163 const pageRoot = path . resolve ( path . join ( __dirname , "${ publishDir } " , "server" ) ) ;
169- const handler = ( ${ makeApiHandler . toString ( ) } ) ( { conf : config , app : "${ appDir } " , pageRoot, NextServer, splitApiRoutes : ${ isSplitApiRoutesEnabled (
170- featureFlags ,
171- ) } } )
164+ const handler = ( ${ makeApiHandler . toString ( ) } ) ( { conf : config , app : "${ appDir } " , pageRoot, NextServer } )
172165 exports . handler = ${ schedule ? `schedule(${ JSON . stringify ( schedule ) } , handler);` : 'handler' }
173166`
0 commit comments