torosent / captureorderack

A containerised Go swagger API to capture orders, write them to MongoDb or CosmosDB and RabbitMQ or EventHubs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CaptureOrder - TACK

A containerised Go swagger API to capture orders, write them to MongoDb and an AMQP message queue.

Usage

Swagger

Access the Swagger UI at http://[host]/swagger

Submitting an order

POST /v1/Order HTTP/1.1
Host: [host]:[port]
Content-Type: application/json

{
  "EmailAddress": "test@domain.com",
  "PreferredLanguage": "en"
}

Environment Variables

The following environment variables need to be passed to the container:

Logging

ENV TEAMNAME=[YourTeamName]
ENV APPINSIGHTS_KEY=[YourCustomApplicationInsightsKey] # Optional, create your own App Insights resource
ENV CHALLENGEAPPINSIGHTS_KEY=[Challenge Application Insights Key] # Given by the proctors

For MongoDB

ENV MONGOURL=mongodb://[mongoinstance].[namespace]

For CosmosDB

ENV MONGOURL=mongodb://[CosmosDBInstanceName]:[CosmosDBPrimaryPassword]=@[CosmosDBInstanceName].documents.azure.com:10255/?ssl=true&replicaSet=globaldb

For RabbitMQ

ENV AMQPURL=amqp://[url]:5672

For Service Bus

ENV AMQPURL=amqps://[policy name]:[policy key]@[yourServiceBus].servicebus.windows.net/[queuename]

Make sure your policy key is URL Encoded. Use a tool like: https://www.url-encode-decode.com/

About

A containerised Go swagger API to capture orders, write them to MongoDb or CosmosDB and RabbitMQ or EventHubs.

License:MIT License


Languages

Language:Go 84.0%Language:HTML 14.6%Language:Shell 1.5%