-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (25 loc) · 772 Bytes
/
Copy pathapp.js
File metadata and controls
30 lines (25 loc) · 772 Bytes
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
import express from "express";
import { middlewares } from "./middlewares.js";
// Routes
import { authRoutes } from "./auth/auth_router.js";
import { teamRoutes } from "./team/team_router.js";
// Conexion mongoDB
import { connectionDB } from "./database.js";
await connectionDB();
/*
import { userController } from "./auth/user_controller.js";
await userController.registerUser("bettatech", "1234");
await userController.registerUser("mastermind", "1235");
*/
const app = express();
const port = 3000;
middlewares.setupMiddlewares(app);
app.get("/", (req, res)=>{
res.status(200).send("Hello World!");
});
app.use("/auth", authRoutes);
app.use("/team", teamRoutes);
app.listen(port, ()=>{
console.log("Servidor iniciado en el puerto 3000")
});
export { app };