pongo

Crates.iopongo
lib.rspongo
version0.1.7
sourcesrc
created_at2024-06-23 16:21:12.249679
updated_at2024-07-13 03:03:11.772026
descriptionIntelligent Dorsal admin interface
homepage
repositoryhttps://github.com/hkauso/pongo
max_upload_size
id1281287
size179,773
(hkauso)

documentation

https://docs.rs/pongo

README

🦧 Pongo

Pongo is a simple and intelligent Dorsal-based admin interface for database management.

Examples

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.

Usage

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.

Commit count: 6

cargo fmt