- Clone the repo
- Perform git submodule update as
git submodule init
- Install gems by
bundle install
in the working dir
Make sure you have all the basic steps of setup listed here. Everything should be up and running.
- Run
bundle exec unicorn -c config/unicorn.rb --daemonize
from the PROJECT_DIR. This will start unicorn as a background process. If you want to run unicorn in foreground just drop the--daemonize
part. The log files are located (by default) atPROJECT_DIR/shared/log
. You should go throughconfig/unicorn.rb
to view/update these details. - It accepts
POST
on/events
and/update_push_token
with JSON params - It returns JSON response with the
eventId
. ThiseventId
uniquely identifies the event across Octo. It can be used to trace an event.
Run the following from PROJECT_DIR
kill -s QUIT `cat shared/pids/unicorn.pid`
Kong is the API Gateway we use. It exposes Octo-matic's API to the world and it's upstream is apihandler.
There is a handy utility provided in /bin
which helps create initial kong setup.
$ bin/kong_setup.rb /path/to/config
It should be used for the first time for kong setup. However, it does has dependencies that should be met. For a complete details, check out the documentation here.
Send events in curl as
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'apikey: API_KEY' -d '{
"userId": 2736482,
"browserDetails": {
"name": "chrome",
"manufacturer": "Google",
"platform": "Linux",
"cookieid": "abc123"
}
}' 'http://127.0.0.1:8000/events/app.init/'
# Output/Response
{"eventId":"eef1cafc-2199-428a-b12e-399bd6c7d75f"}