FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
razzle/examples/with-devcert-https/src/index.js at master · javascriptit/razzle · GitHub
javascriptit
razzle
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
razzle
/
examples
/
with-devcert-https
/
src
/
index.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (24 loc) · 663 Bytes
Breadcrumbs
razzle
/
examples
/
with-devcert-https
/
src
/
index.js
Copy path
File metadata and controls
29 lines (24 loc) · 663 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
24
25
26
27
28
29
import
express
from
'express'
;
import
https
from
'https'
;
let
app
=
require
(
'./server'
)
.
default
;
if
(
module
.
hot
)
{
module
.
hot
.
accept
(
'./server'
,
function
(
)
{
console
.
log
(
'🔁 HMR Reloading `./server`...'
)
;
try
{
app
=
require
(
'./server'
)
.
default
;
}
catch
(
error
)
{
console
.
error
(
error
)
;
}
}
)
;
console
.
info
(
'✅ Server-side HMR Enabled!'
)
;
}
const
port
=
process
.
env
.
PORT
||
3000
;
const
credentials
=
HTTPS_CREDENTIALS
||
{
}
;
export
default
https
.
createServer
(
credentials
,
app
)
.
listen
(
port
,
function
(
err
)
{
if
(
err
)
{
console
.
error
(
err
)
;
return
;
}
console
.
log
(
`> Started on port
${
port
}
`
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL