Categorygithub.com/ONSdigital/dp-recipe-api
modulepackage
2.15.0+incompatible
Repository: https://github.com/onsdigital/dp-recipe-api.git
Documentation: pkg.go.dev

# README

DP Recipe API

Getting started

The recipe API can be run by running make debug.

Import recipe data locally

To import recipe's into your local MongoDB instance you can use the import-recipes script

Health check

The endpoint /health checks the connection to the database and returns one of:

  • success (200, JSON "status": "OK")
  • failure (500, JSON "status": "error").

Recipe API

Configuration

Environment variableDefaultDescription
BIND_ADDR:22300The host and port to bind to
MONGODB_BIND_ADDRlocalhost:27017The MongoDB bind address
MONGODB_USERNAMEThe MongoDB Username
MONGODB_PASSWORDThe MongoDB Password
MONGODB_DATABASErecipesThe MongoDB database
MONGODB_COLLECTIONSRecipesCollection:recipesThe MongoDB collections
MONGODB_REPLICA_SETThe name of the MongoDB replica set
MONGODB_ENABLE_READ_CONCERNfalseSwitch to use (or not) majority read concern
MONGODB_ENABLE_WRITE_CONCERNtrueSwitch to use (or not) majority write concern
MONGODB_CONNECT_TIMEOUT5sThe timeout when connecting to MongoDB (time.Duration format)
MONGODB_QUERY_TIMEOUT15sThe timeout for querying MongoDB (time.Duration format)
MONGODB_IS_SSLfalseSwitch to use (or not) TLS when connecting to mongodb
GRACEFUL_SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout in seconds
HEALTHCHECK_INTERVAL30sThe time between calling healthcheck endpoints for check subsystems
HEALTHCHECK_CRITICAL_TIMEOUT90sThe time taken for the health changes from warning state to critical due to subsystem check failures
ZEBEDEE_URLhttp://localhost:8082The URL to Zebedee (for authentication)

Contributing

See CONTRIBUTING for details.

License

Copyright © 2016-2022, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

BuildTime represents the time in which the service was built.
GitCommit represents the commit (SHA-1) hash of the service that is running.
Version represents the version of the service that is running.