Skip to content

cmpprg/sweater_weather_api

Repository files navigation

Sweater Weather

Ruby Version

2.5.3

Description

Sweater Weather is a Rails base API service. It provides information to an imaginary front end team across many endpoints.

Heroku URL / Online Base URL for API

https://sweater-weather-api-rc.herokuapp.com/

Running Locally

Endpoints

  • /api/v1/forecast?location=city,state

    • returns weather information for the location
  • /api/v1/backgrounds?location=city,state

    • returns an appropriate image from Unsplash based on location
  • /api/v1/users

    • pass json in body of request:
    { email: _user@example_,
      password: _value_,
      password_confirmation: _value_ }
    
    • creates users and returns information including email and api-key
  • /api/v1/sessions (returns api-key)

    • pass json in body of request:
    { email: _user@example_,
      password: _value_ }
    
    • returns api-key of user
  • /api/v1/road_trip

    • pass json in body of request:
    { origin: _city,state_,
      destination: _city,state_,
      api-key: _valid api-key_ }
    
    • returns travel time and forecast of destination upon arrival.

Database

  • PostgreSQL
  • rails db:{create,migrate} for setup

Specs

  • Testing with RSpec
  • bundle exec rspec to run all tests
  • bundle exec rspec _filepath_ to run individual specs

Services / API

  • Google API:
    • Directions
    • Geocode
  • OpenWeather API
    • OneCall
  • Unsplash API

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published