FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CodeFace/aspnetcore-https.js at main · CodeFaceIO/CodeFace · GitHub
CodeFaceIO
/
CodeFace
Public template
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
1
Star
8
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CodeFace
/
aspnetcore-https.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (21 loc) · 1 KB
Breadcrumbs
CodeFace
/
aspnetcore-https.js
Copy path
File metadata and controls
26 lines (21 loc) · 1 KB
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
//
@ts
-nocheck
// This script sets up HTTPS for the application using the ASP.NET Core HTTPS certificate
const
fs
=
require
(
'fs'
)
;
const
spawn
=
require
(
'child_process'
)
.
spawn
;
const
path
=
require
(
'path'
)
;
const
baseFolder
=
process
.
env
.
APPDATA
!==
undefined
&&
process
.
env
.
APPDATA
!==
''
?
`
${
process
.
env
.
APPDATA
}
/ASP.NET/https`
:
`
${
process
.
env
.
HOME
}
/.aspnet/https`
;
const
certificateArg
=
process
.
argv
.
map
(
(
arg
)
=>
arg
.
match
(
/
-
-
n
a
m
e
=
(?<
value
>
.
+
)
/
i
)
)
.
filter
(
Boolean
)
[
0
]
;
const
certificateName
=
certificateArg
?
certificateArg
.
groups
.
value
:
process
.
env
.
npm_package_name
;
if
(
!
certificateName
)
{
process
.
exit
(
-
1
)
;
}
const
certFilePath
=
path
.
join
(
baseFolder
,
`
${
certificateName
}
.pem`
)
;
const
keyFilePath
=
path
.
join
(
baseFolder
,
`
${
certificateName
}
.key`
)
;
if
(
!
fs
.
existsSync
(
certFilePath
)
||
!
fs
.
existsSync
(
keyFilePath
)
)
{
spawn
(
'dotnet'
,
[
'dev-certs'
,
'https'
,
'--export-path'
,
certFilePath
,
'--format'
,
'Pem'
,
'--no-password'
]
,
{
stdio
:
'inherit'
,
}
)
.
on
(
'exit'
,
(
code
)
=>
process
.
exit
(
code
)
)
;
}
Back
|
FazBrowse Home
|
New Git URL