blob: b1737829392dde471e930dd9ede1ad74992a8ea5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
require("dotenv").config();
const express = require("express");
const session = require("express-session");
const motto = require("./motto");
const auth = require("./auth");
const quotes = require("./quotes");
const app = express();
app.use(session({ secret: "keyboard cat", resave: false, saveUninitialized: true, cookie: { secure: true } }));
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.get("/", (req, res) => res.redirect("/motto"));
app.use("/motto", motto);
app.use("/auth", auth);
app.use("/quotes", quotes);
app.listen(5005, () => console.log("Server started on http://localhost:5005"));
|