mirror of
https://github.com/anatolykopyl/status.git
synced 2026-03-26 12:54:46 +00:00
Добавил ключи SSL на бэкенд
This commit is contained in:
@@ -30,5 +30,12 @@ app.get('/update', (req, res) => {
|
||||
|
||||
app.use(Express.static(path.join(__dirname, 'public')));
|
||||
|
||||
app.listen(port, () => console.log('Dev server started on ' + port));
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
https.createServer({
|
||||
key: fs.readFileSync('/etc/letsencrypt/live/studybuddy.top/privkey.pem'),
|
||||
cert: fs.readFileSync('/etc/letsencrypt/live/studybuddy.top/cert.pem')
|
||||
}, app)
|
||||
.listen(port, () => console.log('Prod server started on ' + port));
|
||||
} else {
|
||||
app.listen(port, () => console.log('Dev server started on ' + port));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user