Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
index.html
package-lock.json
package.json
server.js

README.md

Edit Text Example

This is an example written in Javascript (Node.js) of a simple text field that can be edited by multiple clients.

  • It exposes a single resource: example.shared.
  • It allows setting the resource's message property through the set method.
  • It resets the model on server restart.
  • It serves a web client at http://localhost:8082

Prerequisite

Install and run

Run the following commands:

npm install
npm start

Open the client

http://localhost:8082

Things to try out

Realtime updates
Run the client in two separate tabs, edit the message in one tab, and observe realtime updates in both.

Web resources

Resources can be retrieved using ordinary HTTP GET requests, and methods can be called using HTTP POST requests.

Get model

GET http://localhost:8080/api/example/shared

Update model

POST http://localhost:8080/api/example/shared/set

Body

{ "message": "Updated through HTTP" }
You can’t perform that action at this time.