2023-02-21 18:46:22 +01:00
|
|
|
# durable object counter
|
|
|
|
|
|
|
|
This app is an exmaple of using a stub to access a direct object. The example
|
|
|
|
is based on the [cloudflare/durable-object-template](https://github.com/cloudflare/durable-objects-template)
|
|
|
|
repository.
|
|
|
|
|
|
|
|
_The durable object is written in js; only the stub is called from go!_
|
|
|
|
|
|
|
|
## Demo
|
|
|
|
|
2023-05-21 11:56:31 +09:00
|
|
|
After `make deploy` the trigger is `http://durable-object-counter.YOUR-DOMAIN.workers.dev`
|
2023-02-21 18:46:22 +01:00
|
|
|
|
|
|
|
* https://durable-object-counter.YOUR-DOMAIN.workers.dev/
|
|
|
|
* https://durable-object-counter.YOUR-DOMAIN.workers.dev/increment
|
|
|
|
* https://durable-object-counter.YOUR-DOMAIN.workers.dev/decrement
|
|
|
|
|
|
|
|
## Development
|
|
|
|
|
|
|
|
### Requirements
|
|
|
|
|
|
|
|
This project requires these tools to be installed globally.
|
|
|
|
|
|
|
|
* wrangler
|
|
|
|
* tinygo
|
|
|
|
|
|
|
|
### Commands
|
|
|
|
|
|
|
|
```
|
|
|
|
make dev # run dev server
|
|
|
|
make build # build Go Wasm binary
|
2023-05-21 11:56:31 +09:00
|
|
|
make deploy # deploy worker
|
2023-02-21 18:46:22 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Author
|
|
|
|
|
|
|
|
akarasz
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
MIT
|