-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (22 loc) · 873 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
"use strict";
const express = require("express");
const path = require("path");
const methodOverride = require("method-override");
const checklistsRouter = require("./src/routes/checklists");
const taskRouter = require("./src/routes/tasks");
const rootRouter = require("./src/routes/index");
require("./config/database");
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(methodOverride("_method", { methods: ["POST", "GET"] }));
app.use(express.static(path.join(__dirname, "public")));
app.set("views", path.join(__dirname, "src/views"));
app.set("view engine", "ejs");
app.use("/", rootRouter);
app.use("/checklists", checklistsRouter);
app.use("/checklists", taskRouter.checklistDependentRoute);
app.use("/tasks", taskRouter.simpleRouter);
app.listen(3000, () => {
console.log("Servidor Iniciado");
});