Skip to content

Commit

Permalink
API cleanup! (#2051)
Browse files Browse the repository at this point in the history
* API cleanup!

* Update swagger.rb

* Update API.md
  • Loading branch information
jywarren authored Jan 19, 2018
1 parent a38ef78 commit 06d481a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/initializers/swagger.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GrapeSwaggerRails.options.url = '/swagger_doc.json'
GrapeSwaggerRails.options.url = 'api/swagger_doc.json'
GrapeSwaggerRails.options.before_filter_proc = proc {
GrapeSwaggerRails.options.app_url = request.protocol + request.host_with_port
}
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#Search RESTful endpoints
#constraints(subdomain: 'api') do
mount Srch::API => '/api'
mount GrapeSwaggerRails::Engine => '/api/d1ocs'
mount GrapeSwaggerRails::Engine => '/api/docs'
#end

resources :rusers
Expand Down
12 changes: 11 additions & 1 deletion doc/API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
(Moved from https://github.com/publiclab/plots2/wiki/API/)

Swagger-generated API documentation can be found at:
## Swagger API

Our Swagger-generated API is quite extensive and growing:

### Web interface/guide

https://publiclab.org/api/docs

https://publiclab.org/api/swagger_doc.json

Expand All @@ -12,6 +18,10 @@ Per-model API endpoints are:
* Notes: https://publiclab.org/api/srch/notes?srchString=foo
* Locations: https://publiclab.org/api/srch/locations?srchString=lat,lon

****

## Legacy API

We also provide RSS feeds for tags and authors, in the format:

* Authors: https://publiclab.org/feed/authorname.rss
Expand Down

0 comments on commit 06d481a

Please sign in to comment.