mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
12 lines
417 B
JavaScript
12 lines
417 B
JavaScript
|
const functions = require('firebase-functions')
|
||
|
const next = require('next')
|
||
|
|
||
|
var dev = process.env.NODE_ENV !== 'production'
|
||
|
var app = next({ dev, conf: { distDir: 'next' } })
|
||
|
var handle = app.getRequestHandler()
|
||
|
|
||
|
exports.next = functions.https.onRequest((req, res) => {
|
||
|
console.log('File: ' + req.originalUrl) // log the page.js file that is being requested
|
||
|
return app.prepare().then(() => handle(req, res))
|
||
|
})
|