-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
48 lines (46 loc) · 1.75 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
const express = require("express")
// const mongoCleint = require("mongodb").MongoClient
const bodyParser = require("body-parser")
const path = require("path")
const app = express()
app.use(bodyParser.json())
const get = require("./controllers/get.controller")
const add = require("./controllers/add.controller")
const delet = require("./controllers/delete.controller")
app.use(express.static(path.join(__dirname, "assets")))
app.set("view engine", "ejs")
app.set("views", "views")
app.get("/", get.getAll)
app.get("/scholars", get.scholars)
app.get("/moshaf", get.moshaf)
app.get("/anashid", get.getAnashid)
app.get("/articles", get.getArticles)
app.get("/lessons", get.getLessons)
app.get("/books", get.getBooks)
app.get("/azan", get.getAzan)
app.get("/photos", get.getPhotos)
app.get("/quotes", get.getQuotes)
app.get("/complaints", get.getComplaints)
app.get("/scholar/:id", get.getScholar)
app.get("/photos/:id", get.getOnePhoto)
app.use("/subject/:id/:type/:typeid", get.getInScholar)
app.use("/admin", add.goAdd)
app.post("/addMan", bodyParser.urlencoded({ extended: true }), add.addMan)
app.post("/addComplaint", bodyParser.urlencoded({ extended: true }), add.addComplaint)
app.use("/deleteMan/:id", delet.deleteMan)
app.use("/delete/:type/:id", delet.deleteInMan)
app.post("/addinMan", bodyParser.urlencoded({ extended: true }), add.addInMan)
app.post("/addQuotes", bodyParser.urlencoded({ extended: true }), add.addQuotes)
app.use((req, res, next) => {
res.status(404).render("404", {
path: req.path
})
})
app.listen(process.env.PORT || 7070, () => {
console.log("go")
setInterval(() => {
console.log("first")
fetch("https://chat-cz51.onrender.com/get/chat-All-users")
//fetch("https://chat-cz51.onrender.com/get/chat-All-users")
}, 50000);
})