-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sers une page de maintenance si
MODE_MAINTENANCE_ACTIF
vaut true
- Loading branch information
Showing
8 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Middleware } from "./serveur.types"; | ||
import { RequestHandler } from "express"; | ||
import * as path from "node:path"; | ||
|
||
export function middleware(): Middleware { | ||
const modeMaintenance: RequestHandler = (_req, reponse, suite) => { | ||
const estEnModeMaintenance = process.env.MODE_MAINTENANCE_ACTIF === "true"; | ||
if (!estEnModeMaintenance) return suite(); | ||
|
||
reponse.sendFile( | ||
path.join(__dirname, "../../../statique/maintenance.html"), | ||
); | ||
}; | ||
|
||
return { modeMaintenance }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Middleware } from "../../serveur.types"; | ||
|
||
export const middlewareFantaisie = (): Middleware => ({ | ||
modeMaintenance: (_req, _res, suite) => suite(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<html lang="fr"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link | ||
rel="preload" | ||
href="/dsfr/fonts/Marianne-Regular.woff2" | ||
as="font" | ||
crossorigin="anonymous" | ||
/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>MonEspaceNIS2 - MAINTENANCE</title> | ||
</head> | ||
|
||
<body style="margin: 0;"> | ||
<div | ||
style=" | ||
font-family: Marianne, arial, sans-serif; | ||
background: #272771; | ||
color: white; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin: 0; | ||
padding: 0; | ||
flex: 1; | ||
flex-direction: column; | ||
height: 100%; | ||
font-size: 2rem; | ||
text-align: center; | ||
" | ||
> | ||
MonEspaceNIS2<br/> | ||
est actuellement en maintenance. | ||
</div> | ||
</body> | ||
</html> |