forked from SchoolOfCode/week-5-hackathon-4real
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
19 lines (14 loc) · 597 Bytes
/
app.js
File metadata and controls
19 lines (14 loc) · 597 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Import the required modules
import express from "express";
import morgan from "morgan";
import charactersRouter from "./routes/characters.js";
import personasRouter from "./routes/personas.js";
// Initialize the express app
const app = express();
// Middleware
app.use(morgan("dev")); // Morgan is used for logging HTTP requests to the console in a developer-friendly format
app.use(express.json()); // express.json() middleware is used to parse incoming JSON requests
// Use sub-routers
app.use("/characters", charactersRouter);
app.use("/personas", personasRouter);
export default app;