Can now query keywords via json
This commit is contained in:
parent
7d9407e76d
commit
e6999e4063
67832
server/db/data.json
Normal file
67832
server/db/data.json
Normal file
File diff suppressed because it is too large
Load Diff
38
server/db/keywords.json
Normal file
38
server/db/keywords.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"hole in the wall": {
|
||||||
|
"food": 0.82,
|
||||||
|
"service": 0.10,
|
||||||
|
"value": 0.22,
|
||||||
|
"atmosphere": -0.79
|
||||||
|
},
|
||||||
|
"high class": {
|
||||||
|
"food": 0.93,
|
||||||
|
"service": 0.80,
|
||||||
|
"value": -0.05,
|
||||||
|
"atmosphere": 0.95
|
||||||
|
},
|
||||||
|
"cheap grub": {
|
||||||
|
"food": -0.42,
|
||||||
|
"service": -0.64,
|
||||||
|
"value": 0.87,
|
||||||
|
"atmosphere": -0.91
|
||||||
|
},
|
||||||
|
"ripoff": {
|
||||||
|
"food": -0.82,
|
||||||
|
"service": -0.64,
|
||||||
|
"value": -0.98,
|
||||||
|
"atmosphere": -0.23
|
||||||
|
},
|
||||||
|
"uninspired": {
|
||||||
|
"food": -0.83,
|
||||||
|
"service": 0.0,
|
||||||
|
"value": 0.0,
|
||||||
|
"atmosphere": -0.68
|
||||||
|
},
|
||||||
|
"moody": {
|
||||||
|
"food": 0.32,
|
||||||
|
"service": -0.33,
|
||||||
|
"value": -0.42,
|
||||||
|
"atmosphere": 0.61
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,22 @@
|
|||||||
#!/usr/bin/env nodejs
|
#!/usr/bin/env node
|
||||||
|
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
var app = express();
|
var keywords = require('./db/keywords.json');
|
||||||
|
var data = require('./db/data.json');
|
||||||
|
|
||||||
app.get('/', function(req, res){
|
function main() {
|
||||||
res.send('hello world');
|
var app = express();
|
||||||
});
|
var router = express.Router();
|
||||||
|
|
||||||
|
router.use('/keywords', function(req, res, next) {
|
||||||
|
res.json(keywords);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.use('/hscd', router);
|
||||||
|
app.listen(3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (require.main === module) {
|
||||||
|
main();
|
||||||
|
}
|
||||||
|
|
||||||
app.listen(3000);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user