This repository has been archived by the owner. It is now read-only.
ARCHIVED: Demo GraphQL API server.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.babelrc
.dockerignore
.editorconfig
.eslintrc
.gitignore
Dockerfile
LICENSE.md
README.md
docker-compose.yml
package.json
yarn.lock

README.md

ARCHIVED: Demo GraphQL API

📔 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 up

Run

Development

All development can be done via Docker Compose. To start the Mongo and GraphQL API servers:

docker-compose up

It can be convenient to start the project in a detached state:

docker-compose up -d && docker-compose logs -f

Service Endpoints

The following services should now be available:

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