REST provides an HTTP interface for persisting and transporting application data through resources. A simple backend exposes one resource, /contents, mapped to a persisted JSON file. section 7.0 section 7.1
A minimal REST API can define each operation through the resource URL and HTTP method:
- GET /contents returns the current JSON contents in the response body. section 7.1
- PUT /contents replaces the persisted contents with the new JSON supplied in the request body. section 7.1
- A frontend client retrieves the resource and saves changes through the backend rather than keeping the AST only in memory. section 7.0
Persisting an AST
An Express server can load contents from storage, respond to GET /contents with JSON, and listen on port 8080. The frontend fetches http://localhost:8080/contents, parses the response as JSON, and places the result into application state. Serializing an AST makes it suitable for storage and HTTP transport; deserializing reconstructs it for use by the frontend. section 7.0 section 7.1
Figure 7.1 Architecture of the frontend and backend for implementing AST persistence
Shows the frontend-backend arrangement used to persist and transport AST data. section 7.0





















