Commit 3577c1e0 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Added GetFetcherDetails route (closes #2)

parent 3bff7a28
node_modules/
......@@ -100,10 +100,10 @@ exports.searchAround = function(req, res) {
*/
exports.searchBbox = function(req, res) {
console.log("[SEARCH] BBox "
+req.query.south+", "+req.query.west+", "+req.query.north+", "+req.query.east
+" between TS "
+req.query.mindate+" and "+req.query.maxdate
+" (use "+req.query.use+" | ignore "+req.query.ignore+")");
+req.query.south+", "+req.query.west+", "+req.query.north+", "+req.query.east
+" between TS "
+req.query.mindate+" and "+req.query.maxdate
+" (use "+req.query.use+" | ignore "+req.query.ignore+")");
const picManager = new P4C.PicturesManager({ fetcherCredentials: CREDENTIALS });
......@@ -132,3 +132,16 @@ exports.searchBbox = function(req, res) {
res.status(500).send({ "status": "NOTOK", "error": e });
}
};
/**
* @api {get} /fetchers List
* @apiDescription The list of available picture providers
* @apiName GetFetchers
* @apiGroup Fetchers
*
* @apiSuccess {String} status The response status (OK)
* @apiSuccess {Array} fetchers The list of fetchers
*/
exports.fetchers = function(req, res) {
res.json({ "status": "OK", "fetchers": (new P4C.PicturesManager()).getFetcherDetails() });
};
......@@ -29,4 +29,7 @@ module.exports = function(app) {
app.route('/search/bbox')
.get(ctrl.searchBbox);
app.route('/fetchers')
.get(ctrl.fetchers);
};
define({ "api": [
{
"type": "get",
"url": "/fetchers",
"title": "List",
"description": "<p>The list of available picture providers</p>",
"name": "GetFetchers",
"group": "Fetchers",
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "String",
"optional": false,
"field": "status",
"description": "<p>The response status (OK)</p>"
},
{
"group": "Success 200",
"type": "Array",
"optional": false,
"field": "fetchers",
"description": "<p>The list of fetchers</p>"
}
]
}
},
"version": "0.0.0",
"filename": "api/controllers/P4CaaSController.js",
"groupTitle": "Fetchers"
},
{
"type": "get",
"url": "/search/around",
......
[
{
"type": "get",
"url": "/fetchers",
"title": "List",
"description": "<p>The list of available picture providers</p>",
"name": "GetFetchers",
"group": "Fetchers",
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "String",
"optional": false,
"field": "status",
"description": "<p>The response status (OK)</p>"
},
{
"group": "Success 200",
"type": "Array",
"optional": false,
"field": "fetchers",
"description": "<p>The list of fetchers</p>"
}
]
}
},
"version": "0.0.0",
"filename": "api/controllers/P4CaaSController.js",
"groupTitle": "Fetchers"
},
{
"type": "get",
"url": "/search/around",
......
......@@ -8,7 +8,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-06-09T10:18:58.997Z",
"time": "2017-06-11T10:53:01.435Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
......
......@@ -8,7 +8,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-06-09T10:18:58.997Z",
"time": "2017-06-11T10:53:01.435Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
......
......@@ -23,7 +23,7 @@
"license"
],
"author": "Adrien Pavie <panieravide@riseup.net> (http://pavie.info/)",
"license": "ISC",
"license": "SEE LICENSE IN LICENSE.txt",
"devDependencies": {
"apidoc": "^0.17.6",
"nodemon": "^1.11.0"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment