-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
50 lines (34 loc) · 1.24 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require("dotenv").config();
// ℹ️ Connects to the database
require("./db");
const mongoose = require("mongoose");
mongoose.set("strictQuery", true);
const express = require("express");
const hbs = require("hbs");
const app = express();
require("./config/session.config")(app);
require("./config")(app);
const projectName = "Hugger";
const capitalized = (string) =>
string[0].toUpperCase() + string.slice(1).toLowerCase();
app.locals.title = `${capitalized(projectName)} by BAM!`;
//handling all routes here
const index = require("./routes/index");
app.use("/", index);
const signUpRoutes = require("./routes/signup.routes");
app.use("/", signUpRoutes);
const loginRoutes = require("./routes/login.routes");
app.use("/", loginRoutes);
const profileRoutes = require("./routes/profile.routes");
app.use("/", profileRoutes);
const communityRouter = require("./routes/post.routes");
app.use("/", communityRouter);
const aboutRoutes = require("./routes/about.routes");
app.use("/", aboutRoutes);
const jounalRoutes = require("./routes/journal.routes.js");
app.use("/", jounalRoutes);
const commentRoutes = require("./routes/comment.routes");
app.use("/", commentRoutes);
//Always comes the Last!
require("./error-handling")(app);
module.exports = app;