https://github.com/jaisonerick/concurrent_example
https://github.com/jaisonerick/concurrent_example
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jaisonerick/concurrent_example
- Owner: jaisonerick
- Created: 2016-04-30T15:58:51.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-30T15:59:07.000Z (about 10 years ago)
- Last Synced: 2025-01-16T18:53:36.493Z (over 1 year ago)
- Language: Ruby
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Concurrent
## Getting Started
After you have cloned this repo, run this setup script to set up your machine
with the necessary dependencies to run and test this app:
% ./bin/setup
It assumes you have a machine equipped with Ruby, Postgres, etc.
## Deploy
Provision your server using ansible. You must have a figaro settings file at
`~/..yml`. The foreman rake task will copy this file to the root
directory of your application. After provisioning, run:
% cap production deploy
% cap production deploy:restart
If you have multiple servers configured in production, the restart will be with
one server at a time, avoiding offline time.
## Puma configuration
The figaro settings is not loaded before puma, so you must setup puma variables
using the `.env` file. These environment variables are: `WEB_CONCURRENCY` and
`MAX_THREADS`.
## Get user balance:
```
curl -X "GET" "http://localhost:3000/users/1" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
```
## Add user credit:
```
curl -X "POST" "http://localhost:3000/users/1/credits" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d $'{
"credit": {
"amount": 10
}
}'
```