-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
33 lines (26 loc) · 834 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// // // Imports
// // Import express
// import express from "express";
// // Import cors
// import cors from "cors";
// // Import posts routes
// import {postsRoutes} from "./Routes/postsRoutes.js";
// // Import login route(s)
// import {loginRoutes} from "./Routes/loginRoutes.js";
// // Declare the app variable set to express
// const app = express();
// app.use(express.static("public"))
// // Set the app.use methods
// app.use(cors());
// app.use(express.json());
// app.use("/posts", postsRoutes);
// app.use("/login", loginRoutes);
// // Error handling for use of an incorrect filepath
// app.use((_req, res, _next) => {
// res.status(404).json({
// success: false,
// error: "Incorrect file path. Please try /posts"
// });
// });
// // Export the app variable as default
// export default app;