This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// All using... | |
namespace My.Awesome.Namespace.Api | |
{ | |
public class Startup | |
{ | |
// ... | |
public void ConfigureServices(IServiceCollection services) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios"; | |
type HttpVerb = "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; | |
class ApiClient { | |
private static singleton: ApiClient; | |
private readonly instanceAxios: AxiosInstance; | |
private URL: string = "https://localhost:44300/"; | |
private constructor() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ApiClient { | |
instance(): ApiClient; | |
get<T>(url: string): Promise<T>; | |
post<T>(url: string, body: any): Promise<T>; | |
put<T>(url: string, body: any): Promise<T>; | |
patch<T>(url: string, body: any): Promise<T>; | |
delete<T>(url: string): Promise<T>; | |
} |