Skip to content

flotte-berlin/apollo-server

 
 

Repository files navigation

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
DATABASE_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
  • DATABASE_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.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.8%
  • Other 1.2%