Skip to content

Server Modes

Server modes change how yRest behaves at runtime — from auto-reloading the database on file changes to rejecting all writes, simulating latency, or saving state snapshots. Modes can be combined freely.

--watch / watch: true

--readonly / readonly: true

--delay <ms> / delay: 500

--snapshot / snapshot: true

Snapshot mode saves the initial state of the database at startup and exposes three meta endpoints:

EndpointDescription
GET /_snapshotSnapshot metadata (saved timestamp)
POST /_snapshot/saveSave current state as new snapshot
POST /_snapshot/resetRestore to last saved snapshot

--pageable [limit] / pageable: true

--id-strategy increment|uuid / idStrategy: uuid