1

Changing node paths

This commit is contained in:
Alex Yatskov 2014-10-02 16:41:47 +09:00
parent 1ef7cae451
commit 75763046b4
2 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@
maxResults: ctx.maxResults maxResults: ctx.maxResults
}; };
$.getJSON('/node/search', query, function(results) { $.getJSON('/search', query, function(results) {
var hintData = {}; var hintData = {};
for (var keyword in results.columns) { for (var keyword in results.columns) {
hintData[keyword] = results.columns[keyword].hints; hintData[keyword] = results.columns[keyword].hints;
@ -41,7 +41,7 @@
maxResults: parseInt($('#maxResults').val()) maxResults: parseInt($('#maxResults').val())
}; };
$.getJSON('/node/search', query, function(results) { $.getJSON('/search', query, function(results) {
ctx.searchParams = query.searchParams; ctx.searchParams = query.searchParams;
ctx.searchRange = query.searchRange; ctx.searchRange = query.searchRange;
ctx.minScore = query.minScore; ctx.minScore = query.minScore;
@ -78,7 +78,7 @@
params: ctx.searchParams params: ctx.searchParams
}; };
$.getJSON('/node/addKeyword', query, function(results) { $.getJSON('/add_keyword', query, function(results) {
if (results.success) { if (results.success) {
$('#learnDialog').modal('hide'); $('#learnDialog').modal('hide');
} }
@ -99,7 +99,7 @@
keyword: $('#keywordToForget').val() keyword: $('#keywordToForget').val()
}; };
$.getJSON('/node/removeKeyword', query, function(results) { $.getJSON('/remove_keyword', query, function(results) {
if (results.success) { if (results.success) {
$('#forgetDialog').modal('hide'); $('#forgetDialog').modal('hide');
} }
@ -136,7 +136,7 @@
ready: function() { ready: function() {
$('#keywordsToSearch').selectpicker(); $('#keywordsToSearch').selectpicker();
$.getJSON('/node/getKeywords', function(keywords) { $.getJSON('/get_keywords', function(keywords) {
$('#searchKeywords').click(onSearch); $('#searchKeywords').click(onSearch);
for (var i = 0, count = keywords.length; i < count; ++i) { for (var i = 0, count = keywords.length; i < count; ++i) {
$('#keywordsToSearch').append($('<option></option>', { $('#keywordsToSearch').append($('<option></option>', {
@ -152,7 +152,7 @@
$('#forgetKeyword').click(onForget); $('#forgetKeyword').click(onForget);
$('#forgetDialog').on('show.bs.modal', function() { $('#forgetDialog').on('show.bs.modal', function() {
$('#forgetError').hide(); $('#forgetError').hide();
$.getJSON('/node/getKeywords', function(keywords) { $.getJSON('/get_keywords', function(keywords) {
$('#forgetKeyword').prop('disabled', keywords.length === 0); $('#forgetKeyword').prop('disabled', keywords.length === 0);
$('#keywordToForget').empty(); $('#keywordToForget').empty();
for (var i = 0, count = keywords.length; i < count; ++i) { for (var i = 0, count = keywords.length; i < count; ++i) {

View File

@ -17,19 +17,19 @@ function main() {
'database': 'hscd' 'database': 'hscd'
}); });
app.use('/getKeywords', function(req, res) { app.use('/get_keywords', function(req, res) {
search.getKeywords(function(keywords) { search.getKeywords(function(keywords) {
res.json(_.keys(keywords).sort()); res.json(_.keys(keywords).sort());
}); });
}); });
app.use('/addKeyword', function(req, res) { app.use('/add_keyword', function(req, res) {
search.addKeyword(req.query, function(results) { search.addKeyword(req.query, function(results) {
res.json(results); res.json(results);
}); });
}); });
app.use('/removeKeyword', function(req, res) { app.use('/remove_keyword', function(req, res) {
search.removeKeyword(req.query, function(results) { search.removeKeyword(req.query, function(results) {
res.json(results); res.json(results);
}); });