📔 This project is archived and no longer maintained. It was an early experiment to create a simple, standalone GraphQL server. We have since included a GraphQL API directly in core Reaction.
Install
git clone https://github.com/reactioncommerce/reaction-api-base.git
cd reaction-api-base
docker-compose upRun
Development
All development can be done via Docker Compose. To start the Mongo and GraphQL API servers:
It can be convenient to start the project in a detached state:
docker-compose up -d && docker-compose logs -fService Endpoints
The following services should now be available:
- GraphQL API - http://localhost:3000/graphql
- GraphiQL UI - http://localhost:3000/graphiql
- Subscriptions websocket - ws://localhost:3000/subscriptions
File-Reloading
The project code can be edited on the host machine. The process will be reloaded when code is changed.
Updating Dependencies
In development, you will need to run the following command when the
package.json file is modified:
docker-compose run --rm api yarn install --modules-folder /opt/node_modules docker-compose build api
This command will run yarn install inside the Docker container which will
rebuild yarn.lock and install dependencies. Finally, rebuild the Docker image
to install and cache the dependencies in the image.
Production
The builds are parameterized so that the environment may be specified. The
default is production. The yarn.lock is frozen in production and the build
will fail if an update is needed. To run a production build:
docker build -t reaction-api-base:latest .License
Copyright © MIT