rails-acnh-randomizer / app / controllers / api / v1 / weather_controller.rb
weather_controller.rb
Raw
class Api::V1::WeatherController < ApplicationController
  def show
    @response = HTTParty.get("https://api.weatherapi.com/v1/current.json?key=#{ENV['WEATHER_API_KEY']}&q=#{params[:lat]},#{params[:long]}&aqi=no")
    logger.debug "Response #{@response}" 
    render json: @response
  end
end