-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
37 lines (24 loc) · 839 Bytes
/
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
"use strict";
//Simple app demonstrating node-finereact module
const finereact = require("./node-finereact");
const express = require("express");
const path = require("path");
//initialize the module
finereact.init({
url: "https://13.250.150.80/fineract-provider/api/v1/",
username: "mifos",
password: "password",
});
//The hello world of web servers
const app = express();
let port = process.env.PORT || 3000;
const server = require("http").createServer(app);
const io = require("socket.io")(server);
app.set("view engine", "pug");
app.get("/", (req, res) => res.render("index", {}));
app.use(express.static(path.join(__dirname, "public")));
server.listen(port, () => {
console.log("Web server starting");
});
//Host simple page that allows user to call finereact functions
require("./socket")(io, finereact);