@@ -4,7 +4,6 @@ import type { Bridge as NodeBridge } from '@vercel/node-bridge/bridge'
4
4
import { outdent as javascript } from 'outdent'
5
5
6
6
import type { NextConfig } from '../helpers/config'
7
- import { splitApiRoutes as isSplitApiRoutesEnabled } from '../helpers/flags'
8
7
9
8
import type { NextServerType } from './handlerUtils'
10
9
import type { NetlifyNextServerType } from './server'
@@ -31,11 +30,10 @@ type MakeApiHandlerParams = {
31
30
app : string
32
31
pageRoot : string
33
32
NextServer : NextServerType
34
- splitApiRoutes : boolean
35
33
}
36
34
37
35
// 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 ) => {
39
37
// Change working directory into the site root, unless using Nx, which moves the
40
38
// dist directory and handles this itself
41
39
const dir = path . resolve ( __dirname , app )
@@ -90,7 +88,6 @@ const makeApiHandler = ({ conf, app, pageRoot, NextServer, splitApiRoutes }: Mak
90
88
} ,
91
89
{
92
90
revalidateToken : customContext ?. odb_refresh_hooks ,
93
- splitApiRoutes,
94
91
} ,
95
92
)
96
93
const requestHandler = nextServer . getRequestHandler ( )
@@ -137,13 +134,11 @@ export const getApiHandler = ({
137
134
publishDir = '../../../.next' ,
138
135
appDir = '../../..' ,
139
136
nextServerModuleRelativeLocation,
140
- featureFlags,
141
137
} : {
142
138
schedule ?: string
143
139
publishDir ?: string
144
140
appDir ?: string
145
141
nextServerModuleRelativeLocation : string | undefined
146
- featureFlags : Record < string , unknown >
147
142
} ) : string =>
148
143
// 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)
149
144
javascript /* javascript */ `
@@ -166,8 +161,6 @@ export const getApiHandler = ({
166
161
let staticManifest
167
162
const path = require ( "path" ) ;
168
163
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 } )
172
165
exports . handler = ${ schedule ? `schedule(${ JSON . stringify ( schedule ) } , handler);` : 'handler' }
173
166
`
0 commit comments