Auto Complete
Auto Complete Service File Structure
DirectorySNAPCASTER-BACKEND
Directoryservices
Directoryautocomplete
- .dockerignore
- .gitignore
- docker-entrypoint.sh
- Dockerfile
- package.json
- server.js
- …
GET /health
Depending on whether the user can connect to the MongoDB Collection that contains the Oracle ID (aka card base name), the user will receive either:
HTTPS 200: OK
HTTPS 500 Internal Server Error | MongoDB connection is not available
GET /cards
Returns a list of ScoredMatches objects that contain the base card name information used for text box autocomplete suggestions.
HTTPS 200 OK
HTTPS 400 Provide a valid tcg to search | Provide a query parameter | Unsupported TCG
HTTPS 500 Internal Server Error | Error searching cards by TCG
Cards Object
Property | Type | Details |
---|---|---|
success | Boolean | confirmation if any matches were found |
data | List {"name" : String} | List of 5 card names |
Cards Paramaters
Parameter | Type | Mandatory | Details |
---|---|---|---|
tcg | String | Mandatory | The TCG the user is querying for |
query | String | Mandatory | The search text box value the user is typing in |