README.md: some updates

pull/8/head
leonnicolas 4 years ago
parent 0c2436ba0d
commit 950c276927
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -1,15 +1,12 @@
# API-server # API-server
Apollo server written in typescript that handles business logic. Apollo server written in typescript that handles business logic.
## Assumptions
Userserver and postgres are running e.g. with Julius' Docker Compose.
## Usage ## Usage
### Configure Postgres
Install postgresql and configure it, so the Database is accessible from remote hosts (only necessary for docker container [Here](https://wiki.archlinux.org/index.php/PostgreSQL))
See postgres client config in __ormconfig.json__
### Docker ### Docker
```bash ```bash
docker build -t <image name> . docker build -t <image name> .
docker run --rm --network="host" <image name> docker run --rm -p 4000:4000 <image name>
``` ```
The Dockerfile is pretty stupid and could produce a smaller image, e.g. with multistage build. The Dockerfile is pretty stupid and could produce a smaller image, e.g. with multistage build.
### Compile and run ### Compile and run
@ -33,3 +30,14 @@ And start gulp in watch mode
gulp watch gulp watch
``` ```
This will watch *.ts files in _./src_ and recompile to _./dist_ and finally restart the server. This will watch *.ts files in _./src_ and recompile to _./dist_ and finally restart the server.
## Environment Variables
The following environment variables can be used to configure the server:
```bash
RPC_HOST=host:port
NODE_ENV=development/porduction
POSTGRES_CONNECTION_URL=postgres://username:password@host:port/database_name
```
- __RPC_HOST__ is used for the connection with the userserver.
- __NODE_ENV__ will not check authentication if set to development
- __POSTGRES_CONNECTION_URL__ for connection with the postgres database

Loading…
Cancel
Save