Closed PhilNorman2 closed 4 years ago
I can't give a very detailed review since I don't have any familiarity with ruby/rails, but this definitely looks like a solid start.
OK, I will go ahead and merge this one. Happy to walk you through this or answer questions asynchronously. Once you have the prerequisites it is very simple.
Initial version of cbus biking API. From README.md
Cbus Biking Locations API
API that exposes reports from cyclists including location and description of the incident
Built an deployed using the Ruby on Rails framework.
Prerequisites
Note: The api connects to the local development MySQL server using the root user id and no password.
API application Initialization
After cloning the repo, navigate to /cbus-biking-LOC/api and enter:
bundle install
Database Initialization
Navigate to /cbus-biking-LOC/api
To create the development database on your MySQL server enter:
rake db:create
This creates the database from /cbus-biking-LOC/api/config/database.yml
To create the reports table in your development database enter:
rake db:schema:load
This loads the schema from /cbus-biking-LOC/api/db/schema.rb
To seed the reports table with some sample data enter:
rake db:seed
This loads seed data from /cbus-biking-LOC/api/db/seeds.rb
Start the API application server
rails s
This will start the application server on your localhost at port 3000
Using the API
POST a report
http://localhost:3000/api/reports/
Example JSON body
GET a report by ID
http://localhost:3000/api/reports/1
Example Response:
GET all reports
http://localhost:3000/api/reports