-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
33 lines (26 loc) · 677 Bytes
/
app.js
File metadata and controls
33 lines (26 loc) · 677 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
const express = require("express");
const exphbs = require("express-handlebars");
const {
detail,
success,
pending,
failure,
ipn,
home,
} = require("./controller");
const app = express();
app.use(express.json());
app.engine("handlebars", exphbs());
app.set("view engine", "handlebars");
// Main sections
app.get("/", home);
app.get("/detail", detail);
// Handlers for payment status
app.get("/success", success);
app.get("/pending", pending);
app.get("/failure", failure);
// IPN Controller
app.post("/ipn", ipn);
app.use(express.static("assets"));
app.use("/assets", express.static(`${__dirname}/assets`));
app.listen(process.env.PORT || 3000);