♻️ Simplify domains with api.example.com for API and dashboard.example.com for frontend, improve local development with localhost (#1344)

This commit is contained in:
Sebastián Ramírez
2024-09-19 20:11:33 +02:00
committed by GitHub
parent 110a59c71d
commit 79d240f5b7
11 changed files with 153 additions and 149 deletions

View File

@@ -1 +1 @@
VITE_API_URL=http://localhost
VITE_API_URL=http://localhost:8000

View File

@@ -112,7 +112,7 @@ Notice that everytime the backend changes (changing the OpenAPI schema), you sho
If you want to use a remote API, you can set the environment variable `VITE_API_URL` to the URL of the remote API. For example, you can set it in the `frontend/.env` file:
```env
VITE_API_URL=https://my-remote-api.example.com
VITE_API_URL=https://api.my-domain.example.com
```
Then, when you run the frontend, it will use that URL as the base URL for the API.
@@ -134,7 +134,7 @@ The frontend code is structured as follows:
The frontend includes initial end-to-end tests using Playwright. To run the tests, you need to have the Docker Compose stack running. Start the stack with the following command:
```bash
docker compose up -d
docker compose up -d --wait backend
```
Then, you can run the tests with the following command:
@@ -157,4 +157,4 @@ docker compose down -v
To update the tests, navigate to the tests directory and modify the existing test files or add new ones as needed.
For more information on writing and running Playwright tests, refer to the official [Playwright documentation](https://playwright.dev/docs/intro).
For more information on writing and running Playwright tests, refer to the official [Playwright documentation](https://playwright.dev/docs/intro).