Skip to content

Commit

Permalink
Added some server.js comments AND .gitignore file to protect env
Browse files Browse the repository at this point in the history
  • Loading branch information
Keagan Aromin authored and Keagan Aromin committed Jan 10, 2025
1 parent babba90 commit bddcf15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
2 changes: 2 additions & 0 deletions backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ dotenv.config();
app.use(express.json()); // to parse the incoming requests with JSON payloads (from req.body)
app.use(cookieParser()); //before running routes call the middleware so we can access cookies (see protectRoute.js)

//all the different routes could be written here, but they would be disorganized
//express's solution to this is middlewares - we can create separate controller or router objects in other files which contain their own controllers
app.use("/api/auth", authRoutes);
app.use("/api/messages", messageRoutes);
app.use("/api/users", userRoutes);
Expand Down

0 comments on commit bddcf15

Please sign in to comment.