mirror of
https://github.com/sasjs/server.git
synced 2026-01-11 08:20:04 +00:00
chore: added https server for production
This commit is contained in:
18
src/prod-server.ts
Normal file
18
src/prod-server.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import path from 'path'
|
||||
import { readFileSync } from 'fs'
|
||||
import * as https from 'https'
|
||||
|
||||
import app from './app'
|
||||
|
||||
const port = 5001
|
||||
const keyPath = path.join('certificates', 'privkey.pem')
|
||||
const certPath = path.join('certificates', 'fullchain.pem')
|
||||
|
||||
const key = readFileSync(keyPath)
|
||||
const cert = readFileSync(certPath)
|
||||
|
||||
const httpsServer = https.createServer({ key, cert }, app)
|
||||
|
||||
httpsServer.listen(port, () => {
|
||||
console.log(`⚡️[server]: Server is running at https://localhost:${port}`)
|
||||
})
|
||||
Reference in New Issue
Block a user