Creating a new project
The first thing you'll need to do is to create a new rails application using the connector template:
The framework work with either ruby-2.3.x or jruby-9.1.510.0. It is always cleaner to use a new gemset (rvm use jruby-9.1.510.0@connector-test --create). You'll may want to create a .ruby-version file in your project folder so that it takes this gemset by default.
...
Code Block | ||
---|---|---|
| ||
# With JRuby rvm use jruby-9.1.510.0@connector-test --create # With MRI rvm use ruby-2.3.1@connector4@connector-test --create # Install rails gem install rails -v '4.2.710' |
Then create your connector project:
...
You will then specify your application API keys in the file config/application.yml
Code Block |
---|
# ThisThese keys are used to encrypt OAuth tokens (or API Keys) and should be set to 256-bit Keys encryption_key1: 'E5CD3EDD6E577441CAB9142A1C36A' encryption_key2: '9B1EF27DF57296E8E1A9143EEB783' SIDEKIQ_USERNAME: admin SIDEKIQ_PASSWORD: password REDIS_URL: redis://localhost:6379/0/connector-test MNO_DEVPL_HOST: https://developer.maestrano.com MNO_DEVPL_API_PATH: /api/config/v1/marketplaces MNO_DEVPL_ENV_NAME: connector-test MNO_DEVPL_ENV_KEY: [API KEY FROM DEVELOPER PLATFORM] MNO_DEVPL_ENV_SECRET:[API SECRET FROM DEVELOPER PLATFORM] |
Health Check
The endpoints perform health check for connector you just created.
/health_check
/health_check/full
/health_check/full performs c
omplete health check (cache, smtp, database, ...). See health_check and the initalizer for the default configuration. There are also additional health_checks that this URL performs , It checks connectivity to Connec! and Dev Platform.
You can override it by creating an initalizer in the connector, eg:
Code Block |
---|
# my-mnoe-app/config/initializers/health_check.rb
HealthCheck.setup do |config|
# You can customize which checks happen on a standard health check
config.standard_checks = %w(cache site)
# You can set what tests are run with the 'full' or 'all' parameter
config.full_checks = %w(cache site custom database migrations)
end |
You can also add custom checks, Refer to health_check Gem.
Local development
To test against a local development environment, create an Environment named Local in the Developer Platform and use your local application URL as the Application Host: http://localhost:3001
...