Giter Club home page Giter Club logo

google_directions_rails_app's Introduction

Google Directions Ride Rails API

About

Just one endpoint for getting rides for a driver sorted by score (highest first) using Google Directions API.

API ACCESS TO GOOGLE DIRECTIONS EXPIRED, OAUTH TOKEN NO LONGER IN USE

Technologies Used

  • Rails 7
  • Ruby 3.1.4
  • Google Directions API
  • RestClient
  • will_paginate
  • RSpec

Setup

  • Clone the GitHub repository: https://github.com/mellowmorgan/hopskip_app.git
  • From the main project directory, enter bundle install in the terminal to populate gems.
  • To create a database and seed, type in your terminal (will also seed test database for rspec): rake db:setup
  • Run local server rails s
  • Run tests with command bundle exec rspec
  • Go to url "localhost:3000/driver/1"

Endpoints Drivers Api

Usage METHOD URL Params
See all rides for a given driver (paginated) GET localhost:3000/drivers/:id?page=PAGE_NUMBER&limit=PER_PAGE id, page, limit
See all rides for a given driver (unpaginated) GET localhost:3000/drivers/:id id

Sample Response

Expect the response for above endpoints to look like...

{
  "driverId": 1,
  "driverHomeAddress: "43 S Broadway, Los Angeles, CA 90013",
  "rides": [
    {
      "rideId": 11,
      "rideScore": 1009.87,
      "rideEarnings": "$2120.73",
      "rideDistance": "157.6 mi",
      "rideDuration": "0.3 hr",
      "rideStartAddress": "1533 Sunset Blvd, Los Angeles, CA 90026",
      "rideEndAddress": "453 South Spring Street Ground Floor, 121 E 5th St SUITE 505, Los Angeles, CA 90013"
    }]
}

Status Codes

Status Code Description
200 OK
400 BAD REQUEST
404 NOT FOUND

google_directions_rails_app's People

Contributors

mellowmorgan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.