This is a simple Typescript API that provides search results from the elasticsearch database. This API uses data from the mentorhub backing Elasticsearch Database.
The OpenAPI specifications for the API can be found in the docs
folder, and are served here
- MentorHub Developer Edition - to easily run the containers locally
- NodeJS and NPM - to build and run the API
- StepCI to run black box testing
The typescript files found in ./src/
are used to configure and start an API that will listen to requests on port 8081.
You can use Kibana Console to query the backing elasticsearch database.
npm install
npm run build
npm run test
NOTE: This will down/up backing services
npm run start
NOTE: This assumes backing services are running
npm run local
NOTE: This will down/up backing services
npm run container
npm run precontainer
NOTE: This assumes backing services and the API are running, either locally or in a container
npm run stepci
NOTE: This assumes backing services and the API are running, either locally or in a container
npm run load
In addition to the stepci API testing above, you can use regular curl commands to test the API.
curl 'localhost:8081/api/search?search=curriculum'
curl 'localhost:8081/api/search?search=inactive%20people'
NOTE: The query is a json object, so it has to be http url encoded. The query below uses this query object. { "match": { "lastName": "Smith" } }
curl 'localhost:8081/api/search?query=%7B%22match%22%3A%7B%22lastName%22%3A%22Smith%22%7D%7D'
curl "http://localhost:8081/api/health/"
curl "http://localhost:8081/api/config/"