add endpoint for LetsEncrypt verification and environment variables
This commit is contained in:
parent
acebfe3658
commit
21df3856cf
|
@ -10,6 +10,8 @@ const generateICS = require('./ics')
|
||||||
const { genericErrorHandler, checkURLParameter } = require('./middlewares')
|
const { genericErrorHandler, checkURLParameter } = require('./middlewares')
|
||||||
|
|
||||||
const port = process.env.PORT
|
const port = process.env.PORT
|
||||||
|
const certEndpoint = process.env.CERT_ENDPOINT || ''
|
||||||
|
const certSecret = process.env.CERT_SECRET
|
||||||
const app = express()
|
const app = express()
|
||||||
|
|
||||||
app.set('view engine', 'ejs')
|
app.set('view engine', 'ejs')
|
||||||
|
@ -19,6 +21,10 @@ app.use(express.static(path.join(__dirname, 'public')))
|
||||||
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')))
|
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')))
|
||||||
app.use(bodyParser())
|
app.use(bodyParser())
|
||||||
|
|
||||||
|
app.get(`/${certEndpoint}`, (req, res) => {
|
||||||
|
res.status(200).send(certSecret)
|
||||||
|
})
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
app.get('/', (req, res) => {
|
||||||
res.render('index')
|
res.render('index')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue