Crates.io | pongo |
lib.rs | pongo |
version | 0.1.7 |
source | src |
created_at | 2024-06-23 16:21:12.249679 |
updated_at | 2024-07-13 03:03:11.772026 |
description | Intelligent Dorsal admin interface |
homepage | |
repository | https://github.com/hkauso/pongo |
max_upload_size | |
id | 1281287 |
size | 179,773 |
Pongo is a simple and intelligent Dorsal-based admin interface for database management.
Example usage (serving just the admin panel) can be found in the examples/
directory here.
For a more complete example, you can view a simple Markdown pastebin project which includes Pongo here.
You can add Pongo as a dependency using the command below:
cargo add pongo --no-default-features
The Pongo database should be created and passed into pongo::dashboard::routes
to serve the dashboard and API together.
// https://github.com/hkauso/pongo/blob/master/examples/basic.rs#L19-L27
// create database
let database = Database::new(Database::env_options(), ServerOptions::truthy()).await;
database.init().await;
// create app
let app = Router::new()
.nest("/@pongo", pongo::dashboard::routes(database.clone()))
.nest_service("/static", get_service(ServeDir::new("./static")))
.fallback(pongo::api::not_found);
The location that Pongo is nested under should also be reflected in the PO_NESTED
variable so pages can be linked correctly on the dashboard.
You can configure the location where Pongo will send its static file requests to through the PO_STATIC_DIR
environment variable. This DOES NOT set the location that the local directory is served from, that is up to you!
Pongo expects an available Redis server to be running so that the dashboard can allow Redis key management. Pongo best integrates into other Dorsal-based servers since it'll pull the same database configuration.