Skip to content

Commit 5d4a395

Browse files
committed
support multiple api endpoints besides https://api.github.com
1 parent 456e9b4 commit 5d4a395

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Git.hub/Client.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@ public class Client
1111
{
1212
private RestClient client;
1313

14-
public Client()
14+
/// <summary>
15+
/// Creates a new client instance for github.com
16+
/// </summary>
17+
public Client() : this("https://api.github.com") { }
18+
19+
/// <summary>
20+
/// Creates a new client instance
21+
/// </summary>
22+
/// <param name="apiEndpoint">the host to connect to, e.g. 'https://api.github.com'</param>
23+
public Client(string apiEndpoint)
1524
{
16-
client = new RestClient("https://api.github.com");
25+
client = new RestClient(apiEndpoint);
1726
client.UserAgent = "mabako/Git.hub";
1827
}
1928

0 commit comments

Comments
 (0)