Skip to content

Latest commit

 

History

History
71 lines (55 loc) · 1.06 KB

README.md

File metadata and controls

71 lines (55 loc) · 1.06 KB

Discount Engine

App is deployed Purchase Engine

How to use

To run tests do

npm run test

to run dev

npm run dev

routes

  POST /.netlify/functions/login

expected body,

{
  "email": "hello@example.com",
  "password": "password"
}

can login with details above to get a jwt with bangaroo sydney to test out the $100 discount

  POST /.netlify/functions/purchase

expected headers

  Authorization: Bearer <token>

expected body

{
  "price": 10003.23,
  "description": "this is a purchase",
  "productSKU": "foo"
}

POST /.netlify/functions/signup

expected body

{
  "email": "person@example.com",
  "password": "abc123",
  "name": "person",
  "phoneNumber": "1232131",
  "deliveryAddress": "100 bar street"
}

will return a jwt with the specified fields

postman workspace to try out the requests Workspace