diff --git a/docs/get_started/quickstart.mdx b/docs/get_started/quickstart.mdx index 7dd6e9aa..e4864f2e 100644 --- a/docs/get_started/quickstart.mdx +++ b/docs/get_started/quickstart.mdx @@ -402,6 +402,136 @@ You should now see printed as response: `Hi!` + + + + +- Go: >= 1.21.0 +- Optional but recommended: [Install the Restate Server & CLI](/develop/local_dev#running-restate-server--cli-locally) + + + + + + + ```shell CLI + # link(1:2) /develop/local_dev#running-restate-server--cli-locally + restate example go-hello-world && + cd go-hello-world + ``` + + ```shell npx + npx @restatedev/restate example go-hello-world && + cd go-hello-world + ``` + + ```shell wget + wget https://github.com/restatedev/examples/releases/latest/download/go-hello-world.zip && + unzip go-hello-world.zip -d go-hello-world && + rm go-hello-world.zip && cd go-hello-world + ``` + + + + + + +Now, start developing your service in `greeter.go`. Run it with `go run .`; it will listen on port 9080 for requests. + + + + +Restate is a single self-contained binary. No external dependencies needed. Run it locally via ([or download the binaries](/develop/local_dev#running-restate-server--cli-locally)): + + + + +```shell npx +npx @restatedev/restate-server +``` + +``` shell Homebrew +brew install restatedev/tap/restate-server && restate-server +``` + +```shell Docker +docker run --name restate_dev --rm -p 8080:8080 -p 9070:9070 -p 9071:9071 \ + --add-host=host.docker.internal:host-gateway docker.io/restatedev/restate:VAR::RESTATE_VERSION +``` + + + + + + + +Tell Restate where the service is running, so Restate can discover and register the services and handlers behind this endpoint: + + + +```shell CLI +# link /develop/local_dev#running-restate-server--cli-locally +restate deployments register http://localhost:9080 +``` + +```shell npx +npx @restatedev/restate deployments register http://localhost:9080 +``` + +```shell curl +curl localhost:9070/deployments -H 'content-type: application/json' \ + -d '{"uri": "http://localhost:9080"}' +``` + + + +If you run Restate with Docker, use `http://host.docker.internal:9080` instead of `http://localhost:9080`. + +
+ + Output + + ```shell + โฏ SERVICES THAT WILL BE ADDED: + - Greeter + Type: Service + HANDLER INPUT OUTPUT + Greet value of content-type 'application/json' value of content-type 'application/json' + + + โœ” Are you sure you want to apply those changes? ยท yes + โœ… DEPLOYMENT: + SERVICE REV + Greeter 1 + ``` + +
+ +
+ + + +```shell +curl localhost:8080/Greeter/Greet -H 'content-type: application/json' -d '"Hi"' +``` + +You should now see printed as response: `Hi!` + + + + +
+ +Next: Build and run the app + + Once you have implemented your service, build the app with: + +```shell +go build . +``` + +
+