The eSaude admin API is an Express application that
is built using swagger-node
.
To install the eSaude admin app, first install the prerequisites (Docker & Compose), then follow the eSaude Admin install instructions:
$ wget https://get.esaude.org/app/esaude-app-admin.yml
$ docker-compose -p esaude -f esaude-app-admin.yml up -d
📌 You will need need v1.2.30+
of the eSaude Platform running to use the admin app.
First make sure you have a recent version of Node.js
installed (tested with v7.5.0
). Then, install swagger
globally:
npm install -g swagger
Install the project dependencies:
npm install
To launch the API using Swagger, run:
swagger project start
When launched this way, the API is not running inside Docker, so we don't have access to the platform containers. It's more useful to run a container that runs the code in your working directory:
docker-compose -p esaude -f docker-compose-api-dev.yml up
To launch the Swagger editor, in a separate terminal, run:
swagger project edit
Read the Express and
swagger-node
documentation and make your edits to the Swagger spec and/or Express
controllers.
The API will watch the file system and automatically restart when changes to the Swagger spec or Express controllers are made.
To build a Docker image, first create a production build (see above), then run:
docker build -t esaude-admin-api:dev .
To test the API, run:
npm test