Skip to content

Arielegend/couponlightdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coupons server

Welcome to my coupons service using AWS DynamoDB light container

This service will allow u own your own amazing coupons service!

Just Enter as many coupons by domain_name, coupon_value(must be positive integer less than 100), and a coupon_code

See usage via postman at the buttom

Installation

(Make sure docker is running)

Open a shell, pull image:


  • docker run -p 8000:8000 amazon/dynamodb-local
    • Alt text
    • This container will allow us to perform dynamo DB actions.

In a different shell run:

Once pip finished


Usage

Coupons service has 2 url endpoints:

Alt text

  • POST /ReturnCoupon
    • Post with body as follows:
      • {'codesreturn': str, 'domainreturn': str, 'valuereturn': int}

Alt text




  • Post example:
    • http://127.0.0.1:8000/internal/ReturnCoupon

    • { "codesreturn":"code1 code2 code3", "domainreturn":"domainX", "valuereturn":"10" }

    • Responses examples:

          response = [
          "Successfully added new coupon: (code: code1), (value: 10), (domain: domainX)",
          "Successfully added new coupon: (code: code2), (value: 10), (domain: domainX)",
          "Successfully added new coupon: (code: code3), (value: 10), (domain: domainX)"
          ]
      
           response = [
              "Coupon  --  code: code1, domain: domainX --  already exists!",
              "Coupon  --  code: code2, domain: domainX --  already exists!",
              "Coupon  --  code: code3, domain: domainX --  already exists!"
           ]
      


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages