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) {
var projection = {
min_temps: 1,
max_temps: 1,
location: 1,
}
var t_base = 50
......@@ -128,7 +129,9 @@ exports.year_gdd = function (req, res) {
res.json({
message: "GDDs",
date: data["last_date"],
data: gdds
data: gdds,
closest_lon: data["location"]["coordinates"][0],
closest_lat: data["location"]["coordinates"][1]
})
}, function(err) {
......@@ -152,7 +155,9 @@ exports.year_gdd = function (req, res) {
res.json({
message: "GDDs",
date: data["last_date"],
data: gdds
data: gdds,
closest_lon: data["location"]["coordinates"][0],
closest_lat: data["location"]["coordinates"][1]
})
}, function(err) {
......@@ -187,6 +192,7 @@ exports.normal = function (req, res) {
var projection = {
min_temps: 1,
max_temps: 1,
location: 1,
}
var t_base = 50
......@@ -272,7 +278,9 @@ exports.normal = function (req, res) {
res.json({
message: "30-year Normal GDDs",
data: gdds
data: gdds,
closest_lon: data["location"]["coordinates"][0],
closest_lat: data["location"]["coordinates"][1]
})
}, function(err) {
......
......@@ -41,16 +41,17 @@ var gddController = require('./gddController');
* type: number
* minimum: 24.083334
* maximum: 49.916668
* example: 25.6
* example: 38.99
* longitude:
* description: longitude to calculate gdd on
* type: number
* minimum: -125.0
* maximum: -66.5
* example: -78.5
* example: -76.94
* t_base:
* description: Base temperature to calculate gdd on, in fahrenheit
* description: Base temperature to calculate gdd on, in fahrenheit. NOT REQUIRED
* type: number
* example: 50
*
* responses:
* 200:
......@@ -72,6 +73,16 @@ var gddController = require('./gddController');
* type: number
* minItems: 1
* 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:
* description: Bad Request
* content:
......@@ -131,16 +142,17 @@ router.route('/:product/daily/:year')
* type: number
* minimum: 24.083334
* maximum: 49.916668
* example: 25.6
* example: 38.99
* longitude:
* description: longitude to calculate gdd on
* type: number
* minimum: -125.0
* maximum: -66.5
* example: -78.5
* example: -76.94
* t_base:
* description: Base temperature to calculate gdd on, in fahrenheit
* description: Base temperature to calculate gdd on, in fahrenheit. NOT REQUIRED
* type: number
* example: 50
*
* responses:
* 200:
......@@ -157,6 +169,16 @@ router.route('/:product/daily/:year')
* type: array
* items:
* 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:
* description: Bad Request
* content:
......
......@@ -9,7 +9,7 @@ require('./models/gdd.js');
require('./models/gdd_current.js');
require('./models/normals.js');
const port = 4000;
const port = 27017;
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