-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverAnalyst.js
32 lines (28 loc) · 905 Bytes
/
serverAnalyst.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
const express = require("express");
const app = express();
const server = require('http').createServer(app);
app.use(express.static("public"));
app.set("view engine", "ejs");
const {buildAssociationRules} = require("./readRedis");
app.get("/bigml",async (req, res) => {
var data={
rules:[{leftSide: '-', rightSide:'-',support: '-',confidence: '-', lift:'-'}]
}
res.render("pages/analystics",data);
});
app.get("/bigml/itemsets", async (req, res) => {
/*load_button=false;
var result = await generateItemSets();
parsed = JSON.stringify(result,null,2)
console.log(parsed)
*/
var result = await buildAssociationRules();
var data = {
rules: result,
};
console.log("result");
console.log(result);
res.render("pages/analystics",data);
});
server
.listen(3001, () => console.log(`Listening Socket on http://localhost:3001/bigml`));