-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Readme #226
Update Readme #226
Conversation
src/app.js
Outdated
@@ -102,21 +104,15 @@ routesVersioning({ | |||
}, NoMatchFoundCallback)); | |||
|
|||
function NoMatchFoundCallback(req, res) { | |||
res.status(404).send("Version not found. See https://analytics.usa.gov/developer"); | |||
res.status(404).json("Version not found. Visit https://analytics.usa.gov/developer for information on the latest supported version."); | |||
} | |||
|
|||
// v1 | |||
function respondV1(req, res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottqueen-bixal - i don't have all the context for this loc, but i'm curious why the version would no longer be set and the console log message not shown. Is respondV1
function still called anywhere? If so, I'd still expect it to return a v1.1
response. At a glance, I'm not sure if this is the case or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a request with v1.1
is made it does call respondv1
.
The NoMatchFoundCallback
function handles when we don't have a supported version. For example, if I make a request with v3
in the route path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottqueen-bixal - okay, this makes sense.
I was more curious about
req.params.version = '1.1'
// TODO - report this message to response
console.log('v1 is deprecated. Use v2 instead. See https://analytics.usa.gov/developer')
in the respondv1
function.
It looks like the version isn't being set and the deprecation message removed, and I was wondering why in the first comment.
i guess my question is: if somebody calls v1.1
, do they still get a v1.1 response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were seeing some outdated code on this branch - it's now updated with develop.
We don't log the response there any more. see https://github.com/18F/analytics-reporter-api/blob/develop/src/app.js#L82-L117
Short answer is yes, they absolutely get a response on v1.1
requests.
fixes #227