Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
33fa9312
Commit
33fa9312
authored
Jan 01, 2017
by
Arunoda Susiripala
Committed by
Naoyuki Kanezawa
Jan 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve the path in renderJSON before serving. (#599)
parent
81a67581
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
render.js
server/render.js
+2
-1
No files found.
server/render.js
View file @
33fa9312
...
@@ -5,6 +5,7 @@ import fs from 'mz/fs'
...
@@ -5,6 +5,7 @@ import fs from 'mz/fs'
import
send
from
'send'
import
send
from
'send'
import
accepts
from
'accepts'
import
accepts
from
'accepts'
import
requireModule
from
'./require'
import
requireModule
from
'./require'
import
resolvePath
from
'./resolve'
import
readPage
from
'./read-page'
import
readPage
from
'./read-page'
import
{
Router
}
from
'../lib/router'
import
{
Router
}
from
'../lib/router'
import
Head
,
{
defaultHead
}
from
'../lib/head'
import
Head
,
{
defaultHead
}
from
'../lib/head'
...
@@ -97,7 +98,7 @@ async function doRender (req, res, pathname, query, {
...
@@ -97,7 +98,7 @@ async function doRender (req, res, pathname, query, {
}
}
export
async
function
renderJSON
(
req
,
res
,
page
,
{
dir
=
process
.
cwd
()
}
=
{})
{
export
async
function
renderJSON
(
req
,
res
,
page
,
{
dir
=
process
.
cwd
()
}
=
{})
{
const
pagePath
=
join
(
dir
,
'.next'
,
'bundles'
,
'pages'
,
`
${
page
}
.json`
)
const
pagePath
=
await
resolvePath
(
join
(
dir
,
'.next'
,
'bundles'
,
'pages'
,
page
)
)
return
serveStaticWithGzip
(
req
,
res
,
pagePath
)
return
serveStaticWithGzip
(
req
,
res
,
pagePath
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment