The Opensearch container is quite big, roughly 1.3 GB. This might present a problem for those on a metered connection looking to contribute.
This is a simple Typescript API that provides search results from the search database. This API uses data from a backing Elasticsearch Database.
Here are all of the repositories in the mentorHub system
The OpenAPI specifications for the API can be found in the docs
folder, and are served here
The typescript files found in ./src/
are used to configure and start an API that will listen to requests on port 8081. to install dependencies and run locally. You can run the backing service with
mh up opensearchonly
or if you don't have MentorHub Developer Edition installed:
docker run -d -p 9200:9200 -e "discovery.type=single-node" -e "plugins.security.disabled=true" -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD:Z3i**BEl6YTJsDKrK3AgVO" opensearchproject/opensearch:2.12.0
Use the following command to build and run the container locally. See here for details on how to stop/start the database.
../src/docker/docker-build.sh
After that command completes successfully you can verify it worked successfully by running curl tests or postman to confirm the build.
Note: You can change the "query: jame"
header to another query. Just replace the text on the right-side of the colon. "query: <your-query>"
curl -X GET "http://localhost:8081/api/search/" -H "accept: application/json" -H "query: jame"
curl -X GET "http://localhost:8081/api/health/" -H "accept: */*"
curl -X GET "http://localhost:8081/api/config/" -H "accept: */* "
search-api.postman_collection.json
).