1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Default query to {}, same behaviour as next export (#4466)

This commit is contained in:
Tim Neutkens 2018-05-25 14:27:18 +02:00 committed by GitHub
parent 2c3e8d3201
commit e9242705a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -264,9 +264,9 @@ export default class Server {
console.log('Defining routes from exportPathMap')
const exportPathMap = await this.nextConfig.exportPathMap({}) // In development we can't give a default path mapping
for (const path in exportPathMap) {
const options = exportPathMap[path]
const {page, query = {}} = exportPathMap[path]
routes[path] = async (req, res, params, parsedUrl) => {
await this.render(req, res, options.page, options.query, parsedUrl)
await this.render(req, res, page, query, parsedUrl)
}
}
}