Skip to content

Commit

Permalink
add api link
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbradford committed Feb 13, 2024
1 parent bf8922c commit 7e06268
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Binary file added app/assets/images/hal-250px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@

<hr>

<div class="row">
<div class="left">
<%= link_to image_tag("hal-250px.png"), api_path %>
</div>
<div>
<h2><%= link_to "Weather Data API", api_path %></h2>
<p>All of the weather data accessible on this site can also be accessed via our API for free. A description of the API endpoints can be found at the link above. These endpoints are subject to change so if you are using this data in an application please <%= link_to "contact us", action: :about %> to let us know and we will keep you in the loop about any API changes.</p>
</div>
</div>

<hr>

<div class="row">
<div class="left">
<%= link_to image_tag("tree-150px.png"), action: :about %>
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def route(action, verb = :get, *other_verbs)
get "/subscribers/(*path)", to: redirect("/subscribers")

# Custom URLs
direct(:api) { "/api" }
direct(:vdifn) { "/vdifn" }
direct(:wisp) { "https://wisp.cals.wisc.edu" }
direct(:vegpath) { "https://vegpath.plantpath.wisc.edu" }
Expand All @@ -128,6 +129,7 @@ def route(action, verb = :get, *other_verbs)

mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?

get "/ag_weather", to: redirect("/api/")
get "*unmatched", to: redirect("/") if Rails.env.production?
post "*unmatched", to: "application#bad_request" if Rails.env.production?
post "/", to: "application#bad_request" if Rails.env.production?
Expand Down

0 comments on commit 7e06268

Please sign in to comment.