disable matrix layer by default

This commit is contained in:
hippoz 2022-10-30 01:14:39 +03:00
parent 49d8032638
commit 53689fdaf6
Signed by: hippoz
GPG key ID: 7C52899193467641

View file

@ -5,13 +5,17 @@ import messagesRouter from "./routes/api/v1/messages";
import matrixRouter from "./routes/matrix"; import matrixRouter from "./routes/matrix";
import { errors } from "./errors"; import { errors } from "./errors";
const ENABLE_MATRIX_LAYER = false;
export default function(app: Application) { export default function(app: Application) {
app.use(json()); app.use(json());
app.use("/api/v1/users", usersRouter); app.use("/api/v1/users", usersRouter);
app.use("/api/v1/channels", channelsRouter); app.use("/api/v1/channels", channelsRouter);
app.use("/api/v1/messages", messagesRouter); app.use("/api/v1/messages", messagesRouter);
app.use("/", express.static("frontend/public")); app.use("/", express.static("frontend/public"));
if (ENABLE_MATRIX_LAYER) {
app.use("/", matrixRouter); app.use("/", matrixRouter);
}
const errorHandler: ErrorRequestHandler = (error, req, res, next) => { const errorHandler: ErrorRequestHandler = (error, req, res, next) => {
console.error("error: while handling request", error); console.error("error: while handling request", error);