Caleb1991 / rails-engine-1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Whether Sweater

Table of Contents
  1. About The Project
  2. Setup
  3. Endpoints

About The Project

Sweater weather.... I mean, Whether Sweater is an API that allows you the user to plan a road trip. In doing so, as long as it is a viable destination, you will be able to see the origin city, the destination city, travel time, and estimated weather in the destination city upon arrival.

Through this project the following learning goals were achieved: *Consumption of multiple API's * Following RESTful conventions when creating API endpoints * Exposing aggregated data through serializers

Built With

Setup

Clone this repo
Run bundle install
Run bundle exec figaro install
Run rails db:create

You will need to get api_keys from the following websites:

and store them in your application.yml file:

#config/application.yml

API_KEY = 'ENTER YOUR API'

Endpoints

Below endpoints will append to base connector: http://localhost:3000

Method URL Detail
GET '/api/v1/forecast?location={location}' Location must be sent as 'Denver,CO' or 'Phoenix,AZ'. Returns current forecast for given location, including next five days and next eight hours.
GET '/api/v1/backgrounds?location={location}' Location must be sent as 'Denver,CO' or 'Pheonix,AZ'. Returns url of a background image to display for given location.
POST '/api/v1/users' A post request can be sent to the above uri, sending over the email, password, and password confirmation in the body of the request as JSON. If successful, it will return the user's email and the api key they have been issued.
POST '/api/v1/sessions' A post request can be sent to the above uri, sending over email and password in the body of the request as JSON. If successful, it will return the given user's email and api_key.
POST '/api/v1/road_trip' A post request can be sent to the above uri, sending over an origin (ex. 'Denver,CO), a destination (ex. 'Phoenix,AZ), and a valid api key in the body of the request. If the locations are able to be traversed via car, and the api key is valid, the response will send the destination and origin city, total travel time, and estimated weather upon arrival at destination city.

About


Languages

Language:Ruby 100.0%