📔 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.
git clone https://github.com/reactioncommerce/reaction-api-base.git
cd reaction-api-base
docker-compose upAll development can be done via Docker Compose. To start the Mongo and GraphQL API servers:
docker-compose upIt can be convenient to start the project in a detached state:
docker-compose up -d && docker-compose logs -fThe following services should now be available:
- GraphQL API - http://localhost:3000/graphql
- GraphiQL UI - http://localhost:3000/graphiql
- Subscriptions websocket - ws://localhost:3000/subscriptions
The project code can be edited on the host machine. The process will be reloaded when code is changed.
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 apiThis 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.
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 .Copyright © MIT