diff options
| author | Fuwn <[email protected]> | 2024-05-14 22:15:28 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-14 22:15:28 +0000 |
| commit | ccc5f53b683174732337dd516d762a3ff575a536 (patch) | |
| tree | 44e28d801c691aa7c5b5893ef411773e2917bed2 | |
| parent | docs(readme): add default demo (diff) | |
| download | mayu-ccc5f53b683174732337dd516d762a3ff575a536.tar.xz mayu-ccc5f53b683174732337dd516d762a3ff575a536.zip | |
docs(readme): usage and database information
| -rw-r--r-- | README.md | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -15,6 +15,18 @@ Mayu is written in [Gleam](https://gleam.run) and uses [SQLite](https://sqlite.o ## Usage +Mayu currently has seven available themes selectable using the `theme` query parameter of any `get` operation. + +E.g., [counter.due.moe/get/@demo?theme=urushi](https://counter.due.moe/get/@demo?theme=urushi) + +- `asoul` +- `gelbooru-h` (NSFW) +- `gelbooru` +- `moebooru-h` (NSFW) +- `moebooru` +- `rule34` (NSFW) +- `urushi`. + ### Local ```bash @@ -29,10 +41,22 @@ $ gleam run docker run --volume 'mayu:/mayu/data/' -p '80:3000' --rm fuwn/mayu:latest ``` +This Docker command uses a named volume, `mayu`, which allows the Mayu's database to persist between container restarts. + ### Database Mayu will use SQLite by default and will place the database file, `count.db`, within the `data/` directory of the project's root directory. +Mayu has the same default database layout as Moe-Counter, so if you've already used Moe-Counter previously, Mayu will work off of any previously accumulated counter data, so long as you transfer the database file over. + +Mayu additionally adds two database columns: `created_at` and `updated_at`, which will not affect standard operations in any way, but will allow for additional data to be available should you perform a `record` operation. + +### Routes + +- `/heart-beat`: `alive` +- `/get/@name`: An `image/xml+svg` counter, defaulting to theme `asoul`, modifiable using the `theme` query parameter +- `/record/@name`: JSON object containing the database's `name`, `num`, `created_at`, and `updated_at` fields for counter `name` + ## Resource Attributions - [A-SOUL_Official](https://space.bilibili.com/703007996) |