Skip to content

Commit

Permalink
Merge pull request #125 from agiledev-students-fall2023/Jaden's-Branch
Browse files Browse the repository at this point in the history
deployment changes
  • Loading branch information
anaspacheco authored Dec 6, 2023
2 parents 7e5ac14 + f88ca8f commit 93e4c9b
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 93e4c9b

Please sign in to comment.