1

Can now query keywords via json

This commit is contained in:
Alex Yatskov 2014-07-22 13:36:12 +09:00
parent 7d9407e76d
commit e6999e4063
3 changed files with 67889 additions and 7 deletions

67832
server/db/data.json Normal file

File diff suppressed because it is too large Load Diff

38
server/db/keywords.json Normal file
View 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
}
}

View File

@ -1,10 +1,22 @@
#!/usr/bin/env nodejs
#!/usr/bin/env node
var express = require('express');
var app = express();
var keywords = require('./db/keywords.json');
var data = require('./db/data.json');
app.get('/', function(req, res){
res.send('hello world');
function main() {
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();
}