Skip to content
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

Merged
merged 2 commits into from
Jan 26, 2024
Merged

Update Readme #226

merged 2 commits into from
Jan 26, 2024

Conversation

scottqueen-bixal
Copy link
Contributor

@scottqueen-bixal scottqueen-bixal commented Jan 19, 2024

  • updates readme version path note

fixes #227

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@scottqueen-bixal scottqueen-bixal changed the title Update readme Update Readme and request messaging for v2 routing Jan 24, 2024
@scottqueen-bixal scottqueen-bixal changed the title Update Readme and request messaging for v2 routing Update Readme Jan 24, 2024
@scottqueen-bixal scottqueen-bixal merged commit e1c5408 into develop Jan 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update documentation in analytics-reporter-api repository README.md
2 participants