-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fb2bc01
Showing
500 changed files
with
68,862 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
var express = require('express'); | ||
var app = express(); | ||
|
||
var databaseUrl = 'root:[email protected]:41022/POIDB'; // "username:[email protected]/mydb" | ||
//var databaseUrl = 'localhost/POIDB'; // "username:[email protected]/mydb" | ||
var collections = ['pois', 'poiTypes']; | ||
var db = require('mongojs').connect(databaseUrl, collections); | ||
|
||
//Get the different poi-types | ||
app.get('/types', function(req, res){ | ||
'use strict'; | ||
db.poiTypes.find({}, {Name: 1}, function(err, data){ | ||
res.send(data); | ||
}); | ||
}); | ||
|
||
//Get pois by type(category) | ||
app.get('/pois/:type', function(req, res){ | ||
'use strict'; | ||
|
||
var type = req.params.type; | ||
db.pois.find({POIType: type}, function(err, data){ | ||
res.send(200, data); | ||
}); | ||
}); | ||
|
||
//Get all data | ||
app.get('/pois', function(req, res){ | ||
'use strict'; | ||
var query = req.query; | ||
console.log(query); | ||
db.pois.find(query, function(err, data){ | ||
res.send(200, data); | ||
}); | ||
|
||
}); | ||
|
||
//Search all pois | ||
app.get('/search', function(req, res){ | ||
'use strict'; | ||
var query = req.query; | ||
db.pois.find({'Name': new RegExp(query.query, 'i')}, function(err, data){ | ||
res.send(200, data); | ||
console.log(err); | ||
console.log(data); | ||
}); | ||
}); | ||
|
||
//Not found 404 error stuff | ||
app.get('*', function(req, res){ | ||
'use strict'; | ||
|
||
res.sendfile('error/404.html'); | ||
}); | ||
|
||
app.listen(8087); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<html> | ||
|
||
<head> | ||
<title>Open-DAI Error: 404</title> | ||
<style> | ||
body { | ||
font-family: Arial; | ||
font-size: 9pt; | ||
} | ||
.bigger { | ||
font-size:90pt; | ||
margin:0; | ||
|
||
} | ||
div { | ||
width:600px; | ||
margin:0 auto; | ||
text-align: center; | ||
} | ||
span { | ||
font-weight: bold; | ||
} | ||
p { | ||
font-style: italic; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div> | ||
<img src="https://github-camo.global.ssl.fastly.net/900e822b1e968b32240a7e3e4abbf367363b77b5/687474703a2f2f7777772e6e6574706f72742e73652f77702d636f6e74656e742f75706c6f6164732f323031322f30322f6f70656e2d6461692e6a7067" /> | ||
<h1 class="bigger">404</h1> | ||
<span>Something is wrong and Open-DAI cannot serve you this data. Please choose the right path.</span> | ||
<p>The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested. | ||
The web site hosting server will typically generate a "404 Not Found" web page when a user attempts to follow a broken or dead link; hence the 404 error is one of the most recognizable errors users can find on the web.[1] | ||
A 404 error should not be confused with "server not found" or similar errors, in which a connection to the destination server could not be made at all. A 404 error indicates that the requested resource may be available again in the future; however, the fact does not guarantee the same content.</p> | ||
</div> | ||
</body> | ||
|
||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.