File tree 8 files changed +20
-8
lines changed
8 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"scripts" : {
3
- "dev" : " node server.js"
3
+ "dev" : " node server.js" ,
4
+ "build" : " next build" ,
5
+ "start" : " NODE_ENV=production node server.js"
4
6
},
5
7
"dependencies" : {
6
8
"express" : " ^4.14.0" ,
Original file line number Diff line number Diff line change 1
1
const express = require ( 'express' )
2
2
const next = require ( 'next' )
3
3
4
- const app = next ( { dir : '.' , dev : true } )
4
+ const dev = process . env . NODE_ENV !== 'production'
5
+ const app = next ( { dir : '.' , dev } )
5
6
const handle = app . getRequestHandler ( )
6
7
7
8
app . prepare ( )
Original file line number Diff line number Diff line change 1
1
{
2
2
"scripts" : {
3
- "dev" : " node server.js"
3
+ "dev" : " node server.js" ,
4
+ "build" : " next build" ,
5
+ "start" : " NODE_ENV=production node server.js"
4
6
},
5
7
"dependencies" : {
6
8
"next" : " ^2.0.0-beta"
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ const { createServer } = require('http')
2
2
const { parse } = require ( 'url' )
3
3
const next = require ( 'next' )
4
4
5
- const app = next ( { dev : true } )
5
+ const dev = process . env . NODE_ENV !== 'production'
6
+ const app = next ( { dev } )
6
7
const handle = app . getRequestHandler ( )
7
8
8
9
app . prepare ( )
Original file line number Diff line number Diff line change 1
1
{
2
2
"scripts" : {
3
- "dev" : " node server.js"
3
+ "dev" : " node server.js" ,
4
+ "build" : " next build" ,
5
+ "start" : " NODE_ENV=production node server.js"
4
6
},
5
7
"dependencies" : {
6
8
"next" : " ^2.0.0-beta" ,
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ const { parse } = require('url')
3
3
const next = require ( 'next' )
4
4
const pathMatch = require ( 'path-match' )
5
5
6
- const app = next ( { dev : true } )
6
+ const dev = process . env . NODE_ENV !== 'production'
7
+ const app = next ( { dev } )
7
8
const handle = app . getRequestHandler ( )
8
9
const route = pathMatch ( )
9
10
const match = route ( '/blog/:id' )
Original file line number Diff line number Diff line change 1
1
{
2
2
"scripts" : {
3
- "dev" : " node server.js"
3
+ "dev" : " node server.js" ,
4
+ "build" : " next build" ,
5
+ "start" : " NODE_ENV=production node server.js"
4
6
},
5
7
"dependencies" : {
6
8
"express" : " ^4.14.0" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ const express = require('express')
2
2
const next = require ( 'next' )
3
3
const LRUCache = require ( 'lru-cache' )
4
4
5
- const app = next ( { dir : '.' , dev : true } )
5
+ const dev = process . env . NODE_ENV !== 'production'
6
+ const app = next ( { dir : '.' , dev } )
6
7
const handle = app . getRequestHandler ( )
7
8
8
9
// This is where we cache our rendered HTML pages
You can’t perform that action at this time.
0 commit comments