Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malkiii/hono-war-game
Hono war game ♠♦♣♥
https://github.com/malkiii/hono-war-game
bun cards-game cloudflare-workers github honojs redis upstash
Last synced: 27 days ago
JSON representation
Hono war game ♠♦♣♥
- Host: GitHub
- URL: https://github.com/malkiii/hono-war-game
- Owner: malkiii
- License: mit
- Created: 2023-06-14T11:37:27.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-26T15:50:28.000Z (2 months ago)
- Last Synced: 2024-12-07T08:31:06.993Z (about 1 month ago)
- Topics: bun, cards-game, cloudflare-workers, github, honojs, redis, upstash
- Language: TypeScript
- Homepage: https://github.com/malkiii
- Size: 4.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hono War Game
built using Hono, CF workers and bun. There is two players `player1` and `player2`:
- Any one can play, see [my github profile](https://github.com/malkiii).
- Each one has random 26 cards.
- the game ends when we run out of cards and the one with the highest score wins.
- Click on your pile to play.## Local Usage
1. after installing dependencies using `bun install`, login to you cloudflare account using:
```sh
bunx wrangler login
```2. rename remove .sample from `.dev.vars.sample` file and paste your upstash ENV variables.
3. in the `wrangler.toml` file, add your `CALLBACK_URL` for the `/play` request.
4. start the development server on [localhost:8787](http://localhost:8787/) using:
```sh
bun run dev
```## Game Setup
| Routes | Description |
| ------------------------- | --------------------------------------------------------------------- |
| `/play` | Play the next game (draw a card). |
| `/player/[1 or 2]/:image` | get the current player asset which can be `card`, `pile`, or `score`. |## License
Distributed under the [MIT](https://github.com/malkiii/hono-war-game/blob/master/LICENSE) license.