Skip to content

Commit

Permalink
Support for React build
Browse files Browse the repository at this point in the history
  • Loading branch information
gthomas08 committed Jul 28, 2022
1 parent 83d1519 commit 5913b83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.env
build
8 changes: 4 additions & 4 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ const userLogRouter = require("./controllers/users/log");

const app = express();

app.use(express.json());
app.use(cors());
app.use(middleware.requestLogger);

// Connect to database
mongoose
.connect(config.MONGODB_URI, {
Expand All @@ -37,6 +33,10 @@ mongoose
logger.error("Error connection to MongoDB:", error.message);
});

app.use(cors());
app.use(express.static("build"));
app.use(express.json());

app.use("/api/login", loginRouter);
app.use("/api/users/enrollment", usersEnrollmentRouter);

Expand Down

0 comments on commit 5913b83

Please sign in to comment.