Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arctic-hen7/bertrand
Dead-simple demo system for backend prototypes.
https://github.com/arctic-hen7/bertrand
Last synced: 7 days ago
JSON representation
Dead-simple demo system for backend prototypes.
- Host: GitHub
- URL: https://github.com/arctic-hen7/bertrand
- Owner: arctic-hen7
- License: mit
- Created: 2024-10-26T20:48:13.000Z (12 days ago)
- Default Branch: main
- Last Pushed: 2024-10-26T22:18:03.000Z (12 days ago)
- Last Synced: 2024-10-28T01:47:02.543Z (11 days ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bertrand
Building prototypes for backend systems isn't always easy, so Bertrand lets you define a simple HTML file like this one:
```html
Bertrand Test
This is state A!
This is state B!
This is state C!
```
We've got a few `div`s with the classes `bertrand` and `bstate:`. When we run `bertrand example.html`, we'll have a local file server started (you can customise where with `--host` and `-p`/`--port`) which will, when the index is loaded in a browser, initially display *This is state A!*, because that was `bertrand-init`. However, we can send messages to it with a command like the following:
```
curl -X POST -d "stateB" http://localhost:8080/api/send
```And that will be relayed by the server to all connected clients, who will switch to displaying the `bstate:stateB` `div`. That's pretty much all there is to it!
This lets you easily create state-based demos of backend systems by linking up your backend to Bertrand, and then displaying a browser-based representation of what's going on. In my personal experience, this resonates much more than a CLI demo!
*Note: you can provide either a single HTML file or a directory containing an `index.html` to Bertrand, and it will serve everything in there.*
## Installation
You'll need a [Rust toolchain](https://rustup.rs) to install Bertrand, and then you can run:
```
cargo install bertrand
```## License
See [`LICENSE`](LICENSE).