Back end server for fLotte
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
trivernis 38f5a8a1fe
Merge branch 'develop' of github.com:fLotte-meets-HWR-DB/apollo-server into develop
4 years ago
.github/workflows Create docker.yml 4 years ago
src Merge branch 'develop' of github.com:fLotte-meets-HWR-DB/apollo-server into develop 4 years ago
tests Change insufficient permissions to be an error class 4 years ago
.eslintrc.json Change semi rule to enforce semicolons 4 years ago
.gitignore Merge branch 'main' into develop 4 years ago
.travis.yml .travis.yml: fix docker push 4 years ago
Dockerfile Dockerfile: downgrade npm to fix build 4 years ago
LICENSE.md LICENSE.md: added license and copy right notice 4 years ago
README.md README.md: update 4 years ago
gulpfile.js src/*: implemented update and action log on overwrites 4 years ago
package-lock.json Change insufficient permissions to be an error class 4 years ago
package.json Change insufficient permissions to be an error class 4 years ago
tsconfig.json Change insufficient permissions to be an error class 4 years ago

README.md

API-server

Apollo server written in typescript that handles business logic.

Build Status

Assumptions

The flotte-user-management server and postgres are running. Set the environment variables accordingly.

Usage

Docker

You can build and run a docker image with

docker build -t <image name> .
docker run --rm -p 4000:4000 <image name> -e ...

Don't forget to pass all the environment variables with the -e option.

Compile and Run

Install gulp if not installed

npm -g gulp
npm install
gulp
npm start

You can set the environment variables in a .env file.

For Development

Install node_modules and gulp

npm -g gulp
npm install

Start gulp in watch mode to recompile the type script

gulp watchTs

This will watch *.ts files in ./src and recompile to ./dist. You will have to restart the server yourself.

Environment Variables

The following environment variables can be used to configure the server:

RPC_HOST=host:port
NODE_ENV=develop/production
POSTGRES_CONNECTION_URL=postgres://username:password@host:port/database_name
  • RPC_HOST is used for the connection with the flotte-user-management server.
  • NODE_ENV will not check authentication if set to development
  • POSTGRES_CONNECTION_URL for connection with the postgres database

If the API server cannot connect to the flotte-user-management server or the postgres data base. It will try to reconnect in an endless loop.