anax / remserver
Anax remserver module.
Requires
- php: >=7.4
- anax/commons: ^2.0.14
Requires (Dev)
- anax/anax: ^2.0.17
- phpmetrics/phpmetrics: ^2
- phpunit/phpunit: ^7
README
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.
Use REM server as a web service
This module is bundled together with an Anax website in the repo "Anax REM server website" which is hosted at https://rem.dbwebb.se
.
There you can read the documentation on how to use the REM service and try it out.
Install as an Anax module
This is how you install the module into an existing Anax installation, for example an installation of [anax/anax](https://github.com/canax/anax)
.
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.
Step 1, install using composer.
Install the module using composer.
composer require anax/remserver
Step 2, integrate into your Anax base
You can review the module configuration file in the directory vendor/anax/remserver/config
. It consists of the following parts.
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 users
.
Optionally you may copy the API documentation as Markdown content. Do this only if you have support for Flat File Content from the content/
directory.
rsync -av vendor/anax/remserver/content/index.md content/remserver-api.md
The API documentation is now available through the route remserver-api
.
You can now use the REM server module as an integrated part of you Anax installation.
Dependency
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.