Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

CloudletLabs/clh-web-api

Repository files navigation

clh-web-api - NodeJS API

Preparing to work

Installing Docker

Development process

Preparing Docker

Skip this if you use native Docker (HyperV or OSX native hypervisor)

If we use docker with virtualbox, before we do anything else we need to prepare current cmd/bash session to work with it. I could be done in the following way:

Windows:

@FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i

Linux/Mac:

eval "$(docker-machine env)"

Using Docker

Use the following command to do various things with Docker:

docker-compose -f ./docker-compose.yml -f ./docker-compose.local.yml [command]

Available commands:

build # build container
up # this will run the server
restart # this will restart the server
down # this will destroy server and DB containers

Running tests is somehow harder since we gonna use run Docker command passing some arguments and other commands inside. Also you need to make sure your server is running before you start integration tests.

Running tests:

docker-compose <set of files> run --no-deps --rm clh-web-api npm run test-unit # run unit tests
docker-compose <set of files> run --no-deps --rm clh-web-api npm run test-integration-runner -- -u http://clh-web-api:8087 -s ./swagger/clh-web-api.yml # run integration tests

Locally

npm install # install required dependencies
npm start # start the server
npm run test-unit # run unit tests
npm run dc-test-integration # run integration tests

You should be able to open in your browser http://localhost:8087/?url=clh-web-api.yml and see the app.

Note at the first run on a clean DB it will create some test data. Particularly, default admin access would be admin/admin.

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published