Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Add API version to URLs. #108

Merged
merged 2 commits into from
May 1, 2015
Merged

Conversation

jmcarp
Copy link
Contributor

@jmcarp jmcarp commented Apr 30, 2015

Prefix API URLs with the current API version, starting with v1.

Note: Depends on https://github.com/18F/openFEC/pull/665

[Resolves https://github.com/18F/openFEC/issues/44]

@arowla
Copy link
Contributor

arowla commented Apr 30, 2015

Woooo, our Flask got a Blueprint!

@jmcarp
Copy link
Contributor Author

jmcarp commented Apr 30, 2015

🔷 🐾

.path([API_VERSION, 'names'].join('/'))
.query({
q: '%QUERY',
api_key: '6wpqET5GjxCwAyBqXjc4dWrfMdshFE6wu3txb6yZ'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is api_key supposed to be a constant here? Shouldn't it be reading it from config somehow?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This was a quick hack to get things going for the demo this past
Tuesday.

On Thu, Apr 30, 2015 at 1:11 PM, Marco Segreto [email protected]
wrote:

In static/js/modules/typeahead.js
#108 (comment):

@@ -52,8 +53,13 @@ module.exports = {
url = "/rest/names?q=%QUERY";

 if (typeof API_LOCATION !== 'undefined') {
  •    url = "/names?q=%QUERY&api_key=6wpqET5GjxCwAyBqXjc4dWrfMdshFE6wu3txb6yZ"; // Replace with the correct api key
    
  •    url = API_LOCATION.concat(url);
    
  •    url = URI(API_LOCATION)
    
  •      .path([API_VERSION, 'names'].join('/'))
    
  •      .query({
    
  •        q: '%QUERY',
    
  •        api_key: '6wpqET5GjxCwAyBqXjc4dWrfMdshFE6wu3txb6yZ'
    

is api_key supposed to be a constant here? Shouldn't it be reading it from
config somehow?


Reply to this email directly or view it on GitHub
https://github.com/18F/openFEC-web-app/pull/108/files#r29448969.

Alison Rowland
Technical Lead, https://fbopen.gsa.gov | 18F
202-317-0124

Per discussion with @arowla and @msecret, the public API key will be
rate-limited by IP address, and the private API key will be unlimited.
arowla added a commit that referenced this pull request May 1, 2015
@arowla arowla merged commit 2d53c04 into fecgov:develop May 1, 2015
@arowla arowla removed the in progress label May 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants