FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
DotNetCoreAPI-NextJS/NextJSFrontEnd/server.js at main · ichibi221/DotNetCoreAPI-NextJS · GitHub
ichibi221
/
DotNetCoreAPI-NextJS
Public
forked from
Ajsalemo/DotNetCoreAPI-NextJS
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
DotNetCoreAPI-NextJS
/
NextJSFrontEnd
/
server.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (19 loc) · 555 Bytes
Breadcrumbs
DotNetCoreAPI-NextJS
/
NextJSFrontEnd
/
server.js
Copy path
File metadata and controls
23 lines (19 loc) · 555 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const
express
=
require
(
"express"
)
;
const
next
=
require
(
"next"
)
;
const
port
=
parseInt
(
process
.
env
.
PORT
,
10
)
||
3000
;
const
dev
=
process
.
env
.
NODE_ENV
!==
"production"
;
const
app
=
next
(
{
dev
}
)
;
const
handle
=
app
.
getRequestHandler
(
)
;
app
.
prepare
(
)
.
then
(
(
)
=>
{
const
server
=
express
(
)
;
server
.
get
(
"/"
,
(
req
,
res
)
=>
{
return
app
.
render
(
req
,
res
,
"/"
)
;
}
)
;
server
.
all
(
"*"
,
(
req
,
res
)
=>
{
return
handle
(
req
,
res
)
;
}
)
;
server
.
listen
(
port
,
(
err
)
=>
{
if
(
err
)
throw
err
;
console
.
log
(
`> Ready on port:
${
port
}
`
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL