mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 13:56:29 +02:00
Adds https support; Fixes prod config
This commit is contained in:
15
src/routes/certbot.ts
Normal file
15
src/routes/certbot.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/* Copyright Coplay. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at https://coplay.org/colicense */
|
||||
import { NextFunction, Request, Response, Router } from "express"
|
||||
import * as path from "path"
|
||||
|
||||
const certbotRouter: Router = Router()
|
||||
|
||||
certbotRouter.use((request: Request, response: Response, _next: NextFunction) => {
|
||||
const filename = request.originalUrl.replace(/.*\//, "")
|
||||
const resolvedPath: string = path.resolve(`../certbot/.well-known/acme-challenge/${filename}`)
|
||||
console.log("response", resolvedPath)
|
||||
response.setHeader("Content-Type", "text/html")
|
||||
return response.sendFile(resolvedPath)
|
||||
})
|
||||
|
||||
export default certbotRouter
|
Reference in New Issue
Block a user