Commit 3e03fee2 authored by Lukáš Huvar's avatar Lukáš Huvar Committed by Tim Neutkens

Fix build only server-side `/api/index.js` (#8167)

* Build error for index API routes

* Fix server build
parent 9659b4b5
......@@ -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)
......
/* eslint-disable-next-line */
import fs from 'fs'
export default (req, res) => {
res.send('Index should work')
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment