Fix build only server-side /api/index.js
(#8167)
* Build error for index API routes * Fix server build
This commit is contained in:
parent
9659b4b555
commit
3e03fee278
2 changed files with 4 additions and 1 deletions
|
@ -68,7 +68,7 @@ export function createEntrypoints(
|
|||
Object.keys(pages).forEach(page => {
|
||||
const absolutePagePath = pages[page]
|
||||
const bundleFile = page === '/' ? '/index.js' : `${page}.js`
|
||||
const isApiRoute = bundleFile.match(API_ROUTE)
|
||||
const isApiRoute = page.match(API_ROUTE)
|
||||
|
||||
const bundlePath = join('static', buildId, 'pages', bundleFile)
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/* eslint-disable-next-line */
|
||||
import fs from 'fs'
|
||||
|
||||
export default (req, res) => {
|
||||
res.send('Index should work')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue