-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (27 loc) · 843 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
import express from "express";
import cors from "cors";
//importacion de modulos
import { mesasRouter } from "./mesas.js";
import { reservacionRouter } from "./reservaciones.js";
import { menuRouter } from "./menu.js";
import { ordenRouter } from "./orden.js";
import { authConfig, authRouter } from "./auth.js";
import { personalRouter } from "./personal.js";
const app = express();
app.use(express.json());
app.use(cors());
authConfig();
// uso de Routers
app.use("/mesas", mesasRouter);
app.use("/reservaciones", reservacionRouter);
app.use("/menu", menuRouter);
app.use("/orden", ordenRouter);
app.use("/auth", authRouter)
app.use ("/personal", personalRouter)
//ruta raiz
app.get("/", (req, res) => {
res.send("RESTAURANTE");
});
app.listen(4000, () => {
console.log("API en funcionamiento");
});