mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
add endpoint for LetsEncrypt verification and environment variables
This commit is contained in:
@ -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')
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user