-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
52 lines (36 loc) · 947 Bytes
/
Copy pathserver.js
File metadata and controls
52 lines (36 loc) · 947 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const express = require("express");
const app = express();
const cookieParser=require("cookie-parser");
app.use(cookieParser());
require("dotenv").config();
app.use(express.static('public'));
app.set('view engine', 'ejs');
app.use(express.text())
app.use(express.json());
app.use(express.urlencoded({
extended: true
}));
app.get("/",(req,res)=>{
res.render("landing");
})
app.get("/textUpload",(req,res)=>{
res.render("textUpload")
})
app.get("/textFiles",(req,res)=>{
res.redirect("/notes/textNotes")
})
app.get("/gallery",(req,res)=>{
res.render("gallery");
})
app.get("/imageUpload",(req,res)=>{
res.render("imageUpload");
})
const authRouter=require("./routes/auth");
const noteRouter=require("./routes/notes");
app.use("/auth",authRouter);
app.use("/notes",noteRouter);
const db=require("./db");
app.listen(process.env.PORT || 3000, () => {
console.log("Server started at port 3000");
db();
})