Tags: Models
Simple service serving a message to the world.
git clone https://github.com/jirenius/go-res
cd go-res/examples/01-hello-world
go run .
- Open the browser and go to:
http://localhost:8080/api/example/model
- Open Chrome and go to resgate.io - resource viewer.
- Type in the resource ID below, and click View:
example.model
Note
Chrome allows websites to connect to localhost, while other browsers may give a security error.
- Stop the project, and change the
"Hello, World!"
message in main.go. - Restart the project and observe how the message is updated in the viewer (see above).
- In the resgate.io - resource viewer, open the DevTools console (Ctrl+Shift+J).
- Type the following command, and press Enter:
client.get("example.model").then(m => console.log(m.message));
Note
The resource viewer app stores the ResClient instance in the global
client
variable, for easy access.