-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow accessing the web UI from webpack (#1074)
Trello: https://trello.com/c/8fSBUP9P/3594-3-improve-agama-web-server-integration-with-the-web-ui ## Accessing Agama server through webpack When developing the web UI, you need to access Agama web server. Similarly to what we implemented for Cockpit, you can access it directly by setting the `AGAMA_SERVER` environment variable. By default, it is set to `localhost:3000`. ```sh AGAMA_SERVER=localhost:4567 npm run server ``` The API is available under the `/api` path. ```javascript const ping = await fetch("/api/ping"); ``` ## Service the web UI in `agama-web-server` The new Agama web server will expose the web UI in the root (`/`) path. By default, it uses `$HOME/.local/agama/web-ui`, falling back to `/usr/share/agama/web-ui`. However, you can override that route using the new `--public-dir` argument. ```sh agama-web-server serve --public-dir /srv/agama/web-ui ``` NOTE: Additionally, we could implement support for reading the public directory from an environment variable (e.g., `AGAMA_PUBLIC_DIR`). In that case, you could use `dotenv` (or your favorite alternative) to set it automatically to `../web/dist`. # Tasks - [x] Access Agama server from webpack - [x] Serve the web UI through `agama-web-server` - [x] Move the API to `/api` - [x] Update the documentation
- Loading branch information
Showing
8 changed files
with
158 additions
and
64 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.