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:
- Ruby (2.1.0)
- Ruby on Rails (4.1.0)
- MySQL
- jQuery
- Devise
- Omniauth
- httparty
- omniauth-google-oauth2
- kaminari
- Bootstrap (v2.3.1)
- rails-settings-cached
- exception_notification
- 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
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).
The endpoints app can be deployed through Capistrano. The deploy.rb
file located in the config folder needs to be customized.
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.
The host where is application is deployed needs to be set in the config/production.rb (see config.action_mailer.default_url_options
).
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.
- Tests
The endpoints app is released under the MIT License.