-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.js
64 lines (58 loc) · 1.54 KB
/
router.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const express = require("express");
const session = require('express-session');
const app = express();
app.use(express.urlencoded({ extended: false }));
app.use(express.json()); // parse form data client
app.use(session({
secret: 'secret',
resave: true,
saveUninitialized: true
}));
const { } = require("./routes/admin");
const { initilize } = require("./routes/initilize");
const {
getLoginPage,
authUser,
getDashboardPage,
logOut
} = require("./routes/login_feature");
const {
addAccountPage,
addAccount,
deleteAccount,
editAccount,
editAccountPage,
verifyEditAccountPage,
showAccountPage,
showAccount,
getViewAll
} = require("./routes/user");
const {
transactionPage,
fundTransferPage,
makeTransaction,
transferFund
} = require("./routes/transaction");
// routes for the app
//GET
app.get("/", getLoginPage);
app.get("/dashboard", getDashboardPage);
app.get("/view_all", getViewAll);
app.get("/init", initilize);
app.get("/add", addAccountPage);
app.get("/edit", editAccountPage);
app.get("/view", showAccountPage);
// app.get("/delete/", deleteAccount);
app.get("/logout/", logOut);
app.get("/transaction", transactionPage);
app.get("/fundtransfer", fundTransferPage);
//POST
app.post("/", authUser);
app.post("/add", addAccount);
app.post("/edit", verifyEditAccountPage);
app.post("/verifyEdit", editAccount);
app.post("/view", showAccount);
app.post("/delete/", deleteAccount);
app.post("/transaction/", makeTransaction);
app.post("/fundtransfer/", transferFund);
module.exports = app;