mirror of
https://github.com/comatory/fb2iCal
synced 2025-01-27 23:59:19 +01:00
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 port = process.env.PORT
|
||||
const certEndpoint = process.env.CERT_ENDPOINT || ''
|
||||
const certSecret = process.env.CERT_SECRET
|
||||
const app = express()
|
||||
|
||||
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(bodyParser())
|
||||
|
||||
app.get(`/${certEndpoint}`, (req, res) => {
|
||||
res.status(200).send(certSecret)
|
||||
})
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.render('index')
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user