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
77c10b24
Commit
77c10b24
authored
Jan 13, 2018
by
Arunoda Susiripala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes the unused renderScript function
parent
33f8f282
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
17 deletions
+0
-17
render.js
server/render.js
+0
-17
No files found.
server/render.js
View file @
77c10b24
...
@@ -7,7 +7,6 @@ import generateETag from 'etag'
...
@@ -7,7 +7,6 @@ import generateETag from 'etag'
import
fresh
from
'fresh'
import
fresh
from
'fresh'
import
requireModule
from
'./require'
import
requireModule
from
'./require'
import
getConfig
from
'./config'
import
getConfig
from
'./config'
import
resolvePath
from
'./resolve'
import
{
Router
}
from
'../lib/router'
import
{
Router
}
from
'../lib/router'
import
{
loadGetInitialProps
}
from
'../lib/utils'
import
{
loadGetInitialProps
}
from
'../lib/utils'
import
Head
,
{
defaultHead
}
from
'../lib/head'
import
Head
,
{
defaultHead
}
from
'../lib/head'
...
@@ -125,22 +124,6 @@ async function doRender (req, res, pathname, query, {
...
@@ -125,22 +124,6 @@ async function doRender (req, res, pathname, query, {
return
'<!DOCTYPE html>'
+
renderToStaticMarkup
(
doc
)
return
'<!DOCTYPE html>'
+
renderToStaticMarkup
(
doc
)
}
}
export
async
function
renderScript
(
req
,
res
,
page
,
opts
)
{
try
{
const
dist
=
getConfig
(
opts
.
dir
).
distDir
const
path
=
join
(
opts
.
dir
,
dist
,
'bundles'
,
'pages'
,
page
)
const
realPath
=
await
resolvePath
(
path
)
await
serveStatic
(
req
,
res
,
realPath
)
}
catch
(
err
)
{
if
(
err
.
code
===
'ENOENT'
)
{
renderScriptError
(
req
,
res
,
page
,
err
,
{},
opts
)
return
}
throw
err
}
}
export
async
function
renderScriptError
(
req
,
res
,
page
,
error
,
customFields
,
{
dev
})
{
export
async
function
renderScriptError
(
req
,
res
,
page
,
error
,
customFields
,
{
dev
})
{
// Asks CDNs and others to not to cache the errored page
// Asks CDNs and others to not to cache the errored page
res
.
setHeader
(
'Cache-Control'
,
'no-store, must-revalidate'
)
res
.
setHeader
(
'Cache-Control'
,
'no-store, must-revalidate'
)
...
...
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