forked from atulapra/Emotion-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (23 loc) · 705 Bytes
/
index.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
var fs = require('fs');
const path = require("path");
while(true){
var data= fs.readFileSync(path.resolve(__dirname, './src/emotion.json'));
var student = JSON.parse(data);
console.log(student);
}
var elements = JSON.parse(data);
const express = require("express");
const app = express();
// To solve the cors issue
const cors=require('cors');
const PORT=process.env.PORT || 4444;
app.listen(PORT,
() => console.log("Server Start at the Port ${PORT}"));
app.use(express.static('public'));
app.use(cors());
// when get request is made, alldata() is called
app.get(data);
function data( response) {
// Returns all information about the elements
response.send();
}