diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx index 4007556a..f8f02792 100644 --- a/docs/quickstart.mdx +++ b/docs/quickstart.mdx @@ -26,12 +26,16 @@ npx -y @restatedev/create-app && cd restate-node-template First, get all dependencies and build tools. Then build the app: ```shell -npm install && npm run build +npm install ``` Now, you are all set to start developing your service in `src/app.ts`. +You can run the app with `ts-node-dev` while developing: +```shell +npm run app-dev +``` -## Step 3: Build and Run the Greeter service +## Step 3: Build and Run the service Once you have implemented your service, build the app and run it: ```shell npm run build @@ -51,10 +55,17 @@ Run the Restate Docker container: docker run --name restate_dev --rm -d --network=host ghcr.io/restatedev/restate-dist:VAR::RESTATE_DIST_VERSION ``` -Discover the services: +Register the service: + +Now, we need to tell Restate where the service is running. +We do this by sending a request to the endpoint of the runtime at `http://localhost:8081/endpoints` +and providing it with the endpoint of the service `http://localhost:8080`. ```shell curl -X POST http://localhost:9070/endpoints -H 'content-type: application/json' -d '{"uri": "http://localhost:9080"}' ``` +Restate then sends a request to the service endpoint to ask which services and methods +are running behind this endpoint and will keep track of these (including of the method signatures). +After executing this curl request, you should see the discovered services and methods printed to your terminal. @@ -66,17 +77,23 @@ Run the Restate Docker container: docker run --name restate_dev --rm -d -p 8080:8080 -p 9070:9070 -p 9071:9071 ghcr.io/restatedev/restate-dist:VAR::RESTATE_DIST_VERSION ``` -Discover the services: +Register the services: +Now, we need to tell Restate where the service is running. +We do this by sending a request to the endpoint of the runtime at `http://localhost:8081/endpoints` +and providing it with the endpoint of the service `http://host.docker.internal:8080`. ```shell curl -X POST http://localhost:9070/endpoints -H 'content-type: application/json' -d '{"uri": "http://host.docker.internal:9080"}' ``` +Restate then sends a request to the service endpoint to ask which services and methods +are running behind this endpoint and will keep track of these (including of the method signatures). +After executing this curl request, you should see the discovered services and methods printed to your terminal. -## Step 5: Send requests to the Greeter service +## Step 5: Send requests to the service Invoke the function via: