Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yPhil
Pétrolette
Commits
84f8bead
Commit
84f8bead
authored
Mar 17, 2021
by
yPhil
Browse files
HTTPS OK
parent
98181d84
Pipeline
#398648
passed with stage
in 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
http/server.js
View file @
84f8bead
...
...
@@ -9,14 +9,15 @@ const petrolette = require('../petrolette'),
var
httpServer
=
http
.
createServer
(
petrolette
);
httpServer
.
listen
(
8000
,
()
=>
{
console
.
error
(
'
HTTP Server running
'
);
console
.
debug
(
'
HTTP Server running
'
);
});
// const httpsServer = https.createServer({
// key: fs.readFileSync(path.join(__dirname, '../cert/privkey.pem'), 'utf8'),
// cert: fs.readFileSync(path.join(__dirname, '../cert/cert.pem'), 'utf8'),
// }, petrolette);
const
httpsServer
=
https
.
createServer
({
key
:
fs
.
readFileSync
(
'
/etc/letsencrypt/live/petrolette.space/privkey.pem
'
),
cert
:
fs
.
readFileSync
(
'
/etc/letsencrypt/live/petrolette.space/cert.pem
'
),
ca
:
fs
.
readFileSync
(
'
/etc/letsencrypt/live/petrolette.space/chain.pem
'
),
},
petrolette
);
//
httpsServer.listen(
443
, () => {
//
console.
log
('HTTPS Server running');
//
});
httpsServer
.
listen
(
8001
,
()
=>
{
console
.
error
(
'
HTTPS Server running
?
'
);
});
petrolette.js
View file @
84f8bead
...
...
@@ -26,12 +26,6 @@ app.use('/static', express.static(path.join(__dirname, 'public')));
app
.
use
(
'
/bower
'
,
express
.
static
(
path
.
join
(
__dirname
,
'
bower_components
'
)));
app
.
use
(
'
/
'
,
router
);
// app.use(express.static(__dirname, { dotfiles: 'allow' } ));
// app.listen(80, () => {
// console.log('HTTP server running on port 80');
// });
app
.
use
(
helmet
.
originAgentCluster
());
app
.
use
(
helmet
.
noSniff
());
app
.
use
(
bodyParser
.
json
());
...
...
yPhil
@yphil
mentioned in issue
#59 (closed)
·
Mar 17, 2021
mentioned in issue
#59 (closed)
mentioned in issue #59
Toggle commit list
Write
Preview
Supports
Markdown
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