-
Notifications
You must be signed in to change notification settings - Fork 2
API module
Dmitry Usik edited this page Apr 3, 2022
·
13 revisions
The project contains the base layer for axios
which can be configured in axiosBase.ts.
The main methods (get
, post
, put
) from the HTTP
protocol are implemented. The other methods could be also implemented based on demand.
If the API you're using has a different business logic part then you need to separate them between different folders. Let's overview the files from the countries
folder.
All the API
requests should be implemented in countriesApi.ts using the methods from the base layer.
All the remote types should be specified in types.ts.
All the API-related constants should be kept in config.ts.
The base URL can be configured in axiosBase.ts.