This repository contains the code for the API service that communicates to the Database and exposes endpoints to interact with it.
No endpoint documentation is available yet since this API is not meant to be used publicly.
In order to develop for this repository you need:
- Node.js v20.18.0 (but any
v20
should work fine) - Docker
- Have env-development running locally.
First, clone this repository:
git clone https://github.com/starpep-web/api-service
Install the dependencies:
npm install
Create an .env
file with the following contents:
PORT=4000
NEO4J_DB_URI=bolt://localhost:7687
Run the dev:watch
script:
npm run dev:watch
And done, the service should be reachable at http://localhost:4000
.
Some testing commands are available to you:
This command will run the TypeScript type checker for any compile errors.
This command will run the linter to check for any styling errors.
This command will run the linter and fix any fixable styling errors.
This command will run unit tests once.
This command will run the unit test runner in watch-mode.
If you're developing this on your local machine, consider building the Docker image with the following command:
docker build -t local-starpep/api-service:latest .
You can create a new container to try it out with the following command:
docker run -it --rm -p 4000:4000 -e NEO4J_DB_URI=bolt://localhost:7687 local-starpep/api-service:latest
And done, the service should be reachable at http://localhost:4000
.
Consider checking this docker-compose.yml for an example on how to run this image in production.