The web service for the publications app. Built with Docker, Node.js, and MongoDB.
Install Docker, then run
./quickstart.sh
. The server will become available at
http://localhost:4000.
If you wish to use the "Try it Out" buttons to send requests to live servers, be sure to select the appropriate server from the dropdown at the top.
You will need these setup on your machine to manage your workflow.
- yarn (
brew install yarn
) or npm (brew install npm
)- Note, the commands below will use
yarn
, but you can substitute innpm
.
- Note, the commands below will use
- Docker
To install the dependencies and do initial setup: cd api
then, yarn install
.
You should only need to do this when you first clone or package.json is
changed.
With the dependencies installed, run docker-compose up
from the project
root to start a development server. The api should be available at
http://localhost:2000.
When testing with the docs page, be sure to select the localhost server from the dropdown.
First, create a production configuration or copy the example file with
cp docker-compose.prod.yml{.example,}
.
Run docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --build
to start a production server. Alternatively, run ./restart.sh
to run
production in the background. Either way, the production api will be
available at the port specified in the production configuration file.
When deploying on a server, ssh in, git pull
, then run ./restart.sh
to
rebuild and restart the docker services.