Skip to content

Commit

Permalink
fix: maintenance page
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianGille committed Aug 19, 2024
1 parent a1f40c9 commit 2e858d5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
7 changes: 7 additions & 0 deletions packages/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,13 @@ app.get(
mosaicoEditor.render
);

const maintenanceEditor = require('./maintenance/maintenance.controller.js');
app.get(
'/maintenance',
// maintenanceEditor.exposeHelpersToPug,
maintenanceEditor.render
);

const nuxt = new Nuxt(nuxtConfig);
const isNuxtReady =
config.isDev && !config.nuxt.preventBuild
Expand Down
22 changes: 20 additions & 2 deletions packages/server/maintenance/maintenance.controller.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
'use strict';

const asyncHandler = require('express-async-handler');

// const config = require('../node.config.js');
// const simpleI18n = require('../helpers/server-simple-i18n.js');

module.exports = {
// exposeHelpersToPug: exposeHelpersToPug,
render: asyncHandler(render),
};

// function exposeHelpersToPug(req, res, next) {
// res.locals.getLocale = function getLocale() {
// return req.user.lang;
// };
// res.locals.__ = (key) => simpleI18n(key, req.user.lang);
// res.locals._config = {
// isDev: config.isDev,
// host: config.host,
// };
// res.locals.printJS = function (data) {
// return JSON.stringify(data, null, ' ');
// };
// next();
// }

async function render(req, res) {
res.render('maintenance-pages/maintenance-page');
res.render('maintenance-page');
}

0 comments on commit 2e858d5

Please sign in to comment.