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

* Build error for index API routes

* Fix server build
This commit is contained in:
Lukáš Huvar 2019-07-30 14:52:43 +02:00 committed by Tim Neutkens
parent 9659b4b555
commit 3e03fee278
2 changed files with 4 additions and 1 deletions

View file

@ -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)

View file

@ -1,3 +1,6 @@
/* eslint-disable-next-line */
import fs from 'fs'
export default (req, res) => {
res.send('Index should work')
}