Skip to content

Commit

Permalink
Use new base url for thunderstore client
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviablaza authored Apr 14, 2024
1 parent a3e5bfa commit 05226cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/thunderstore/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Thunderstore
class Client
property community = ""

BASE_URL = "https://thunderstore.io"

def initialize(@community : String = "")
end

Expand All @@ -14,9 +16,9 @@ module Thunderstore

# Returns the base url for which this client will make API requests to.
def base_url : URI
return URI.parse("https://thunderstore.io") if community.empty?
return URI.parse(BASE_URL) if community.empty?

URI.parse("https://#{community}.thunderstore.io")
URI.parse("#{BASE_URL}/c/#{community}")
end

# Initializes an `HTTP::Client` for the configured `base_url`, and executes a GET request on the specified `path`.
Expand Down

0 comments on commit 05226cd

Please sign in to comment.