-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
40 lines (35 loc) · 942 Bytes
/
server.js
File metadata and controls
40 lines (35 loc) · 942 Bytes
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
var express = require('express');
var app = express();
var github = require('./github.js');
/*
input: search query, gh username
output: search result from Houndify
{
"result" : response
}
*/
app.get('/', function (req, res) {
var query = req.query.query;
var ghusername = req.query.ghusername;
var testQuery = "Show my notifications on Github";
github(testQuery.toLowerCase(), "vwsong", function(response){
res.send(response);
});
// var response;
// hdfy(query, function (response) {
// res.send({
// "result": response
// });
// });
});
//
//function getIntent(query) {
// var listOfIntents = ['GitHub', 'Spotify', 'Chrome', 'Houndify'];
// for (var i = 0; i < listOfIntents.length; i++) {
// if (query.includes(listOfIntents[i]) {
// return listOfIntents[i];
// }
// }
// }
//}
app.listen(3000);