Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

next.js 544 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  1. const next = require('next')
  2. const { NODE_ENV, FEATURE_NEXTJS } = process.env
  3. const isDevelopment = NODE_ENV === 'development'
  4. let nextHandleRequest
  5. if (FEATURE_NEXTJS) {
  6. const nextApp = next({ dev: isDevelopment })
  7. nextHandleRequest = nextApp.getRequestHandler()
  8. nextApp.prepare()
  9. }
  10. module.exports = function renderPageWithNext (req, res, next) {
  11. if (req.path.startsWith('/_next') && !req.path.startsWith('/_next/data')) {
  12. return nextHandleRequest(req, res)
  13. }
  14. next()
  15. }
  16. module.exports.nextHandleRequest = nextHandleRequest
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...