https://github.com/dvinciguerra/ruby-microservices
Ruby simple microservices project made using sinatra
https://github.com/dvinciguerra/ruby-microservices
example-app microservices ruby
Last synced: about 1 year ago
JSON representation
Ruby simple microservices project made using sinatra
- Host: GitHub
- URL: https://github.com/dvinciguerra/ruby-microservices
- Owner: dvinciguerra
- Created: 2019-09-28T11:45:37.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T20:47:26.000Z (over 1 year ago)
- Last Synced: 2025-04-06T23:42:04.447Z (about 1 year ago)
- Topics: example-app, microservices, ruby
- Language: Ruby
- Size: 30.3 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby Microservices
## Using the services
### Auth
#### POST /v1/auth
Command:
```
curl -XPOST "http://localhost:3001/v1/auth" -d $'{ \
"email": "eminetto@gmail.com", \
"password": "1234567" \
}'
```
Result Example:
```json
{
"token": "Authorization:eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjFiYmFlY2Q3LTBhOWUtNGY1NS1iMjVjLTYyMTc0ODYxNWZiZSIsImVtYWlsIjoiZGV2QGV4YW1wbGUub3JnIiwicGFzc3dvcmQiOiJ0ZXN0In0.6nYYTW_vsd6CbPttyEXqlz1kdCAiceqUy3j4RvtNQI4"
}
```
### Services
#### POST /v1/services
Command:
```
curl -XPOST "http://localhost:3002/v1/services" \
-H 'Authorization:eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjFiYmFlY2Q3LTBhOWUtNGY1NS1iMjVjLTYyMTc0ODYxNWZiZSIsImVtYWlsIjoiZGV2QGV4YW1wbGUub3JnIiwicGFzc3dvcmQiOiJ0ZXN0In0.6nYYTW_vsd6CbPttyEXqlz1kdCAiceqUy3j4RvtNQI4' \
-d $'{ \
"type": "compute", \
"size":"micro 2x", \
"preferences":{ \
"storage":{ \
"type":"ssd", \
"size":"512G" \
} \
} \
}'
```
Result Example:
```json
{
"type":"compute",
"size":"micro 2x",
"preferences": {
"storage": {
"type":"ssd",
"size":"512G"
}
}
}
```