Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ipatch/kegcop_web_api
An API for csv files used in conjuction with the KegCop iOS app.
https://github.com/ipatch/kegcop_web_api
api kegcop rails ruby
Last synced: about 1 month ago
JSON representation
An API for csv files used in conjuction with the KegCop iOS app.
- Host: GitHub
- URL: https://github.com/ipatch/kegcop_web_api
- Owner: ipatch
- Created: 2014-07-31T20:40:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-14T08:16:28.000Z (about 2 years ago)
- Last Synced: 2024-04-14T23:59:42.377Z (8 months ago)
- Topics: api, kegcop, rails, ruby
- Language: Ruby
- Homepage: http://kegcop.chrisrjones.com
- Size: 3.11 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## kegcop_web_api [![Build Status](https://travis-ci.org/ipatch/kegcop-web.svg?branch=master)](https://travis-ci.org/ipatch/kegcop-web)
> A rails app powering ⚡️ the API portion of [kegcop.chrisrjones.com](http://kegcop.chrisrjones.com)
## Stack
- Ruby 2.6.3
- Ngnix 1.10.3
- Puma 3.12.4
- JS Runtime: Node.js (V8)## Deployment
```shell
echo "rvm use [RUBY_VERSION_DEFINED_FOR_THIS APP]"
echo "as of March 4, 2020 👇"
rvm ues 2.6.3
ssh-agent
ssh-add ~/.ssh/id_rsa
cap production deploy
```> Keep bundler ≤ 1.17.x in order to deploy a rails 4.2.x app
### / Deployment / heroku
the below error will be rendered in a browser if a `secrets.yml` file is not present
```
An unhandled lowlevel error occurred. The application logs may have details.
```## System dependencies
- Postgres
- [ImageMagick](https://github.com/ImageMagick/ImageMagick)## Working with `curl`
> [httpie](https://github.com/jakubroztocil/httpie) is a sensible alternative to using `curl`
To test the following `documents` endpoint in this application
```shell
curl -I localhost:3000/documents
```The above `curl` request will print just the headers for the `documents` endpoint.
The `-X` flag specifies the command request, ie. `GET`, `POST`, `DELETE`, `PATCH`.
To execute a `GET` request on an endpoint
```shell
curl http://localhost:3000/documents
```To force a `JSON` response from an endpoint
```shell
curl --header "Accept:application/json" http://localhost:3000/documents
```To include the headers in the response, use `-i` flag.
To test sending a `csv` file to the csv_files endpoint
```shell
curl -X POST -F "csv_file=@/path/to/mr-fancy-pants.csv" localhost:3000/documents
```The above `curl` command should successfully send a file to the `documents` endpoint.
## Useful Links
- [How to Import CSV files using rails](http://www.mattmorgante.com/technology/csv)
## TODOs
- [x] ~~deploy app to heroku~~
- [x] ~~exp with ruby 2.6.5, and possibly upgrade app to use ruby 2.6.5~~
- [x] ~~flesh out README~~