Commit d47bba8c authored by Siebers, Michael's avatar Siebers, Michael
Browse files

updated documentation

parent be286a15
......@@ -19,16 +19,20 @@ sequenceDiagram
```
## Running the server
The server component is written in Prolog. Running the server requires [SWI-Prolog](https://www.swi-prolog.org/) in version 8.2.2 or above.
The WebAPI server is implemented as [SWI-Prolog](https://www.swi-prolog.org/) program using several libraries. It requires SWI-Prolog version 8.2.2 or above to run.
The server may operate in two different modes: in _interactive_ mode or as a unix _deamon_.
In the _interactive_ mode the server is running as background _thread_ within the interactive prolog interpreter. This mode allows to inspect and debug the running of the server as well as to apply changes on the fly.
On the other hand, the server runs as background _process_ of the operating system in _daemon_ mode. This mode is intended for production use.
To start the server, clone the git repository.
Before starting the server, you have to clone the git repository.
```bash
git clone git@gitlab.rz.uni-bamberg.de:cogsys/dare2del/demonstrator.git demonstrator-webapi
cd demonstrator-webapi
```
Then start the server using SWI-Prolog, optionally with a custom port (default is 4444).
### Interactive Mode
The interactive mode is started using the `run.pl` script. You may supply a custom port that the server will listen on (default is 4444).
```bash
swipl run.pl
......@@ -65,7 +69,52 @@ After some informational messages (starting with `%`) you will see the interacti
?-
```
You may freely use the Prolog interpreter while the server is running. To stop the server enter `stop_server.`
You may freely use the Prolog interpreter while the server is running.
The server access log is stored in the file `log.txt` in the working directory. To stop the server enter `server_stop.`
### Daemon Mode
> Please note that the _daemon_ mode requires a unix-like operation system to run!
The server is started and stopped in _daemon_ mode using the `daemon.pl` script. As in _interactive_ mode, the server listens on port 4444 per default. This may be configured using the `--port` command line switch.
```bash
swipl daemon.pl
swipl daemon.pl --port 4444
```
After some informational messages (starting with `%`), control is given back to the calling process (the command line) as soon as the server has started successfully. Further output is discarded. (_This includes the informational message that the server has started up successfully._)
```
% Loading explanation templates from file irrelevance_templates:
% file/1
% abs_path/2
% file_size/2
% directory/1
% in_directory/2
% in_directory_recursive/2
% in_directory_recursive/2
% item_name/2
% creation_time/2
% change_time/2
% modification_time/2
% access_time/2
% newer/2
% same_directory/2
```
The server access log is stored in the file `log.txt` in the working directory.
You may use the `--outfile` command line switch to capture the Prolog output after successful server start.
```bash
swipl daemon.pl --outfile daemon.out
```
The daemon is stopped using the `--shutdown` command line switch.
```bash
swipl daemon.pl --shutdown
```
## Documentation
[^local]: Links to localhost in section _Documentation_ assume that you started the server without explicit port option. If you started the server under another port, please replace `4444` accordingly.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment