Skip to content

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:

  1. HTTPS 200: OK
  2. 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.

  1. HTTPS 200 OK
  2. HTTPS 400 Provide a valid tcg to search | Provide a query parameter | Unsupported TCG
  3. HTTPS 500 Internal Server Error | Error searching cards by TCG

Cards Object

PropertyTypeDetails
successBooleanconfirmation if any matches were found
dataList {"name" : String}List of 5 card names

Cards Paramaters

ParameterTypeMandatoryDetails
tcgStringMandatoryThe TCG the user is querying for
queryStringMandatoryThe search text box value the user is typing in