Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
anaspacheco committed Dec 6, 2023
2 parents 6fca239 + 93e4c9b commit 9316f08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion back-end/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const process = require("process");
require("dotenv").config({ silent: true });
const cron = require("node-cron");
const { fetchDataForRoutes } = require("./updateTimetable");

const path = require('path');
const mongoose = require("mongoose");

try {
Expand All @@ -18,6 +18,11 @@ try {
`Error connecting to MongoDB user account authentication will fail: ${err}`
);
}
app.use(express.static(path.join(__dirname, '../front-end/build')));
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../front-end/build', 'index.html'));
});


app.use(morgan("dev", { skip: (req, res) => process.env.NODE_ENV === "test" }));
app.use(express.json());
Expand Down

0 comments on commit 9316f08

Please sign in to comment.