-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
70 lines (44 loc) · 1.49 KB
/
server.js
File metadata and controls
70 lines (44 loc) · 1.49 KB
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
// import {answer, realPhrase} from '/express/index.js'
const http = require('http');
const express = require('express');
const app = express();
const fs = require('fs')
// const client = new NLPCloudClient('paraphrase-multilingual-mpnet-base-v2','2e08600377ac66a4ad5c542a189b6995ed0d33b5')
// client.semanticSimilarity([variable1, variable2]).then(function (response) {
// value = response.data})
app.use(express.json());
app.use(express.static("express"));
// default URL for website
////
app.use('/', (req,res, next) => {
res.locals.test = 'tester'
next()
})
app.use((req, res, next) => {
// count = fs.readFileSync('express/count.txt')
// //console.log("the count right now is at " + count)
// newCount = parseInt(count)+1
// //console.log("After adding, the count is at " + newCount)
// fs.writeFileSync('express/count.txt', newCount.toString())
next()
})
app.get('/', function(req,res, next){
//__dirname : It will resolve to your project folder
res.render(__dirname + 'index.html' + { test });
});
// app.post('/submit', (req, res) => {
// let value
// client.semanticSimilarity([variable1, variable2]).then(function (response) {
// value = response.data})
// res.
// })
app.get('/check', (req, res) =>
{
res.json('penis')
})
/////////
const server = http.createServer(app);
//Element.addEventListener("submitter", computeGuess())
const port = 3000;
server.listen(port);
console.debug('Server listening on port ' + port);