Skip to content

butler-fp7/endpoints

Repository files navigation

Endpoints

Endpoints is a web application that aims at documenting web services. Basically, through a simple web interface, it gives developers a tool to describe their API, by providing the endpoint and the parameters to be sent in the request. It is documented on the Open Platforms website.

See it in action: http://endpoints.open-platforms.eu/.

Endpoints has been mainly developed with the following stack:

Installation

  • Install required gems with bundle install
  • Create a database and configure the database.yml configuration file
  • Run migrations bundle exec rake db:migrate
  • Start the server bundle exec rails s
  • Open a web browser and visit http://localhost:3000

Google OAuth2

Users can be authentified through their Google account. This is made possible thanks to the Devise, Omniauth and omniauth-google-oauth2 gems. In order to enable the Google OAuth2 authentification, OAuth 2.0 credentials (client ID and client secret) have to be requested on the Google Developers Console and used to configure Devise/OmniAuth (see the config.omniauth :google_oauth2 call at the end of the devise.rb file).

Deployment

The endpoints app can be deployed through Capistrano. The deploy.rb file located in the config folder needs to be customized.

Exception Notification

Endpints uses the exception_notification gem to report notifications in production. In order to use it, the config/production.rb file needs to be configured with the sender address (the email address used to send messages) and the list of recipients. These values can be set either as environment variables or directly in the production.rb file.

Host

The host where is application is deployed needs to be set in the config/production.rb (see config.action_mailer.default_url_options).

Google Analytics (or other analytics apps)

The Google Analytics tracking code can be inserted on every page. It has to be set as a setting (rails-settings-cached) stored in the database. To setup the tracking code, fire a console (bundle exec rails c) and set the code with the following command: Settings.google_analytics_tracking_code = "<script> YOUR_TRACKING_CODE_HERE </script>" Please note that this works with any tracking code.

Screenshots

Edit an endpoint Export an endpoint List Use an endpoint Use an endpoint

Todo

  • Tests

Contact

Fabrice Clari (inno TSD)

Licence

The endpoints app is released under the MIT License.

About

Simple solution to document and share API endpoints

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published