Skip to content

Commit

Permalink
Fixed some scope issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanmik committed Apr 28, 2013
1 parent 925eb8b commit d3e1f0a
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion endpoints/bus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports.setup = function(server){
server.post({path: '/bus/realtime', version: '1.0.0'}, realtime);
}

search = function(req, res, next) {
var search = function(req, res, next) {
res.json(404,{error:"This api endpoint has been closed temporarily, because Bus.is changed it's markup."});
return next();

Expand Down
2 changes: 1 addition & 1 deletion endpoints/bus/realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports.setup = function(server){
server.get({path: '/bus/realtime', version: '1.0.0'}, realtime);
}

realtime = function(req, res, next){
var realtime = function(req, res, next){
var data = req.params;

request('http://straeto.is/bitar/bus/livemap/json.jsp', function (error, response, body) {
Expand Down
2 changes: 1 addition & 1 deletion endpoints/bus/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exports.setup = function(server){
//server.post({path: '/bus/search', version: '1.0.0'}, search);
}

search = function(req, res, next) {
var search = function(req, res, next) {
res.json(404,{error:"This api endpoint has been closed temporarily, because Bus.is changed it's markup."});
return next();

Expand Down
2 changes: 1 addition & 1 deletion endpoints/car/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports.setup = function(server){
server.post({path: '/car', version: '1.0.0'}, slash);
}

slash = function(req, res, next){
var slash = function(req, res, next){
var data = req.params;

if(!data.number){
Expand Down
2 changes: 1 addition & 1 deletion endpoints/car/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.setup = function(server){
server.get({path: '/car', version: '1.0.0'}, lookup);
}

lookup = function(req, res, next){
var lookup = function(req, res, next){
var data = req.params;

if(!data.number){
Expand Down
2 changes: 1 addition & 1 deletion endpoints/company/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.setup = function(server){

server.get({path: '/company', version: '1.0.0'}, lookup);
}
lookup = function(req, res, next){
var lookup = function(req, res, next){
res.charSet = 'utf8';

var data = req.params;
Expand Down
2 changes: 1 addition & 1 deletion endpoints/currency/arion.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports.setup = function(server){
server.get({path: '/currency/arion', version: '1.0.0'}, slash);
}

slash = function(req, res, next){
var slash = function(req, res, next){
res.charSet = 'utf8';

var toSend = 'm=GetCurrencies&beginDate='+moment().subtract('days', 1).format('YYYY-MM-DD')+'&finalDate='+moment().format('YYYY-MM-DD')+'&currencyType=AlmenntGengi&currenciesAvailable=ISK%2CUSD%2CGBP%2CEUR%2CCAD%2CDKK%2CNOK%2CSEK%2CCHF%2CJPY%2CXDR';
Expand Down
2 changes: 1 addition & 1 deletion endpoints/currency/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.setup = function(server){
server.post({path: '/currency', version: '1.0.0'}, slash);
}

slash = function(req, res, next){
var slash = function(req, res, next){
var data = req.params;
res.charSet = 'utf8';

Expand Down
2 changes: 1 addition & 1 deletion endpoints/domainlookup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.setup = function(server){
server.get({path: '/whois', version: '1.0.0'}, slash);
}

slash = function(req, res, next){
var slash = function(req, res, next){

var data = req.params;

Expand Down
2 changes: 1 addition & 1 deletion endpoints/flight/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.setup = function(server){
server.post({path: '/flight', version: '1.0.0'}, slash);
}

slash = function(req, res, next){
var slash = function(req, res, next){

var data = req.params,
url = '';
Expand Down
4 changes: 2 additions & 2 deletions endpoints/frontpage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exports.setup = function(server){
server.post({path: '/'}, postSlash);
}

getSlash = function(req, res, next) {
var getSlash = function(req, res, next) {
// fs.readFile('public/index.html', 'utf8', function (err,data) {
// if (err) {
// h.logError(err,err.stack);
Expand All @@ -25,7 +25,7 @@ getSlash = function(req, res, next) {
return next(false);
}

postSlash = function(req, res, next) {
var postSlash = function(req, res, next) {
res.json(200,{"info":"Velkominn á apis.is! Kíktu á docs.apis.is í vafranum þínum fyrir frekari upplýsingar!"});
return next();
}
2 changes: 1 addition & 1 deletion endpoints/house/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.setup = function(server){
server.get({path: '/house', version: '1.0.0'}, slash);
}

slash = function(req, res, next){
var slash = function(req, res, next){
res.charSet = 'utf8';
var fnr = req.params.house;

Expand Down
4 changes: 2 additions & 2 deletions endpoints/static_endpoints/frontpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ exports.setup = function(server){
server.post({path: '/'}, postFrontpage);
}

getFrontpage = function(req, res, next) {
var getFrontpage = function(req, res, next) {
res.header('Location', 'http://docs.apis.is');
res.send(302);
return next(false);
}

postFrontpage = function(req, res, next) {
var postFrontpage = function(req, res, next) {
var obj = {
"info": {
"english": "Hey there! Check out docs.apis.is in your browser for mor info",
Expand Down
2 changes: 1 addition & 1 deletion endpoints/word/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.setup = function(server){
server.post({path: '/word', version: '1.0.0'}, slash);
}

slash = function(req, res, next){
var slash = function(req, res, next){

var data = req.params;

Expand Down

0 comments on commit d3e1f0a

Please sign in to comment.