From 508c2e0dbc523f7e1a6313b54716e12b8a1a629d Mon Sep 17 00:00:00 2001 From: Kirill Antonov Date: Thu, 21 Jul 2022 02:15:08 +0300 Subject: [PATCH] [#85] Updated README Problem: New functionality - new guide Solution: Updated readme on how to boot a `coffer-server` --- README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e619ac9d..7291ed37 100644 --- a/README.md +++ b/README.md @@ -58,18 +58,33 @@ The coffer CLI will look for its configuration file in the following order: ### Web API -Coffer also has a Web API. Currently, it runs on `localhost:8081`. In the future we could configure this but at this moment we can't. +Coffer also has a Web API. It runs on `localhost:$your_port`. +Port can be specified via: +- Cmd line option: `--port` +- Environment varieble `"COFFER_SERVER_PORT"` -You can run server in the following ways: -1. Cabal +Examples: +1. Stack ```shell -$ cabal run coffer-server +$ stack run -- coffer-server --port=8081 ``` -2. Stack + ```shell +$ export COFFER_SERVER_PORT=8081 $ stack run coffer-server ``` +2. Cabal +```shell +$ cabal run -- coffer-server --port=8081 +``` + +```shell +$ export COFFER_SERVER_PORT=8081 +$ cabal run coffer-server +``` + + Documentation for Web API endpoints and their return types could be generated via `servant-openapi3`. (TODO: write something about docs generation after [#114](https://github.com/serokell/coffer/issues/114) is resolved). #### Configuration