Web: Doceditor: added winston to initMiddleware
This commit is contained in:
parent
3f4e4f599c
commit
b7ceb047df
@ -70,6 +70,10 @@ app.get("/products/files/doceditor", async (req, res) => {
|
||||
await i18next.changeLanguage(userLng);
|
||||
const initialI18nStoreASC = i18n.services.resourceStore.data;
|
||||
|
||||
if (initialEditorState?.error) {
|
||||
winston.error(initialEditorState.error.errorMessage);
|
||||
}
|
||||
|
||||
const htmlString = template(
|
||||
initialEditorState,
|
||||
appComponent,
|
||||
|
@ -7,6 +7,11 @@ import path from "path";
|
||||
import { I18nextProvider } from "react-i18next";
|
||||
import fs from "fs";
|
||||
import GlobalStyle from "../components/GlobalStyle.js";
|
||||
import winston from "./logger.js";
|
||||
|
||||
winston.stream = {
|
||||
write: (message) => winston.info(message),
|
||||
};
|
||||
|
||||
const sheet = new ServerStyleSheet();
|
||||
|
||||
@ -15,7 +20,7 @@ export default async (req, res, next) => {
|
||||
path.join(__dirname, "client/manifest.json"),
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
try {
|
||||
req.initialEditorState = await initDocEditor(req);
|
||||
req.assets = JSON.parse(manifest);
|
||||
|
||||
@ -28,6 +33,8 @@ export default async (req, res, next) => {
|
||||
)
|
||||
);
|
||||
req.styleTags = sheet.getStyleTags();
|
||||
|
||||
} catch (e) {
|
||||
winston.error(e.message);
|
||||
}
|
||||
next();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user