Anax remserver module.
Anax REM server (remserver) module implements a REM server. A REM server is a REST Mockup API, useful for development and test of REST clients.
You can use this module, together with an Anax installation, to enable a quickly scaffolded REM server, useful for test, development and prototyping.
This remserver can be used with various HTTP methods to use CRUD operations on predefined datasets. You can add and supply your own JSON datasets which will be loaded by configuration.
The data is stored in the session and can therefore not be shared between users and browsers.
This module is bundled together with an Anax website in the repo "Anax REM server website" which is hosted at
There you can read the documentation on how to use the REM service and try it out.
This is how you install the module into an existing Anax installation, for example an installation of
There are two steps in the installation procedure, 1) first install the module using composer and then 2) integrate it into you Anax base installation.
Install the module using composer.
composer require anax/remserver
You can review the module configuration file in the directory
vendor/anax/remserver/config. It consists of the following parts.
||Add "remserver" as a di service to make it easy to use from the controller, this is implemented by the model class
||These datasets are loaded upon start, when the "remserver" gets activated as a di service. You may add your own dataset to extend the server.|
||The configuration file read by the di service "remserver" when it is activated. Here you decide what datasets to load into.|
||Short explanation on how to add new datasets.|
||The routes supported for the REM server API. All routes are implemented by the
You may copy all the module configuration files with the following command.
# Go to the root of your Anax base repo rsync -av vendor/anax/remserver/config ./
The remserver is now active on the route
remserver/. You may try it out on the route
remserver/users to get the default dataset
Optionally you may copy the API documentation as Markdown content. Do this only if you have support for Flat File Content from the
rsync -av vendor/anax/remserver/content/index.md content/remserver-api.md
The API documentation is now available through the route
You can now use the REM server module as an integrated part of you Anax installation.
This is a Anax modulen and its usage is primarly intended to be together with the Anax framework.
You can install an instance on anax/anax and run this module inside it, to try it out for test and development.
The repo "Anax REM server website" is an example of how that can be done.