ADD: Introduce API client and update axios usage across the application
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
# React + Vite
|
||||
# Listhub Frontend Repository
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
To start developing
|
||||
|
||||
Currently, two official plugins are available:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
||||
and then
|
||||
|
||||
## React Compiler
|
||||
```bash
|
||||
npm run start
|
||||
```
|
||||
|
||||
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
||||
|
||||
## Expanding the ESLint configuration
|
||||
## API configuration
|
||||
|
||||
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
|
||||
The frontend reads the base backend URL from `VITE_API_URL` in `src/config/api.js`.
|
||||
|
||||
- Default: `/api/v1` (works with the Vite dev proxy)
|
||||
- To override it, create a local `.env` file and set `VITE_API_URL` to your backend URL
|
||||
|
||||
See `.env.example` for a ready-to-copy example.
|
||||
|
||||
Reference in New Issue
Block a user