Skip to content
Snippets Groups Projects
Commit c724e463 authored by tuckersiegel's avatar tuckersiegel
Browse files

swagger documentation update

parent a727e330
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ exports.year_gdd = function (req, res) { ...@@ -35,6 +35,7 @@ exports.year_gdd = function (req, res) {
var projection = { var projection = {
min_temps: 1, min_temps: 1,
max_temps: 1, max_temps: 1,
location: 1,
} }
var t_base = 50 var t_base = 50
...@@ -128,7 +129,9 @@ exports.year_gdd = function (req, res) { ...@@ -128,7 +129,9 @@ exports.year_gdd = function (req, res) {
res.json({ res.json({
message: "GDDs", message: "GDDs",
date: data["last_date"], date: data["last_date"],
data: gdds data: gdds,
closest_lon: data["location"]["coordinates"][0],
closest_lat: data["location"]["coordinates"][1]
}) })
}, function(err) { }, function(err) {
...@@ -152,7 +155,9 @@ exports.year_gdd = function (req, res) { ...@@ -152,7 +155,9 @@ exports.year_gdd = function (req, res) {
res.json({ res.json({
message: "GDDs", message: "GDDs",
date: data["last_date"], date: data["last_date"],
data: gdds data: gdds,
closest_lon: data["location"]["coordinates"][0],
closest_lat: data["location"]["coordinates"][1]
}) })
}, function(err) { }, function(err) {
...@@ -187,6 +192,7 @@ exports.normal = function (req, res) { ...@@ -187,6 +192,7 @@ exports.normal = function (req, res) {
var projection = { var projection = {
min_temps: 1, min_temps: 1,
max_temps: 1, max_temps: 1,
location: 1,
} }
var t_base = 50 var t_base = 50
...@@ -272,7 +278,9 @@ exports.normal = function (req, res) { ...@@ -272,7 +278,9 @@ exports.normal = function (req, res) {
res.json({ res.json({
message: "30-year Normal GDDs", message: "30-year Normal GDDs",
data: gdds data: gdds,
closest_lon: data["location"]["coordinates"][0],
closest_lat: data["location"]["coordinates"][1]
}) })
}, function(err) { }, function(err) {
......
...@@ -41,16 +41,17 @@ var gddController = require('./gddController'); ...@@ -41,16 +41,17 @@ var gddController = require('./gddController');
* type: number * type: number
* minimum: 24.083334 * minimum: 24.083334
* maximum: 49.916668 * maximum: 49.916668
* example: 25.6 * example: 38.99
* longitude: * longitude:
* description: longitude to calculate gdd on * description: longitude to calculate gdd on
* type: number * type: number
* minimum: -125.0 * minimum: -125.0
* maximum: -66.5 * maximum: -66.5
* example: -78.5 * example: -76.94
* t_base: * t_base:
* description: Base temperature to calculate gdd on, in fahrenheit * description: Base temperature to calculate gdd on, in fahrenheit. NOT REQUIRED
* type: number * type: number
* example: 50
* *
* responses: * responses:
* 200: * 200:
...@@ -72,6 +73,16 @@ var gddController = require('./gddController'); ...@@ -72,6 +73,16 @@ var gddController = require('./gddController');
* type: number * type: number
* minItems: 1 * minItems: 1
* maxItems: 365 * maxItems: 365
* closest_lat:
* type: number
* minimum: 24.083334
* maximum: 49.916668
* example: 38.99
* closest_lon:
* type: number
* minimum: -125.0
* maximum: -66.5
* example: -76.94
* 400: * 400:
* description: Bad Request * description: Bad Request
* content: * content:
...@@ -131,16 +142,17 @@ router.route('/:product/daily/:year') ...@@ -131,16 +142,17 @@ router.route('/:product/daily/:year')
* type: number * type: number
* minimum: 24.083334 * minimum: 24.083334
* maximum: 49.916668 * maximum: 49.916668
* example: 25.6 * example: 38.99
* longitude: * longitude:
* description: longitude to calculate gdd on * description: longitude to calculate gdd on
* type: number * type: number
* minimum: -125.0 * minimum: -125.0
* maximum: -66.5 * maximum: -66.5
* example: -78.5 * example: -76.94
* t_base: * t_base:
* description: Base temperature to calculate gdd on, in fahrenheit * description: Base temperature to calculate gdd on, in fahrenheit. NOT REQUIRED
* type: number * type: number
* example: 50
* *
* responses: * responses:
* 200: * 200:
...@@ -157,6 +169,16 @@ router.route('/:product/daily/:year') ...@@ -157,6 +169,16 @@ router.route('/:product/daily/:year')
* type: array * type: array
* items: * items:
* type: number * type: number
* closest_lat:
* type: number
* minimum: 24.083334
* maximum: 49.916668
* example: 38.99
* closest_lon:
* type: number
* minimum: -125.0
* maximum: -66.5
* example: -78.5
* 400: * 400:
* description: Bad Request * description: Bad Request
* content: * content:
......
...@@ -9,7 +9,7 @@ require('./models/gdd.js'); ...@@ -9,7 +9,7 @@ require('./models/gdd.js');
require('./models/gdd_current.js'); require('./models/gdd_current.js');
require('./models/normals.js'); require('./models/normals.js');
const port = 4000; const port = 27017;
const app = express(); const app = express();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment