Code Monkey home page Code Monkey logo

pf's Introduction

my implementation of the https://github.com/printify/printify-backend-homework

how to run:

  • clone
  • run docker build --tag whatever2 .&&docker run --publish 8000:8000 --name whatever2 whatever2&&docker rm whatever2 (I hope you have Linux(ish) and Docker)
  • it's alive at http://localhost:8000
  • ^C when done

API:

  • create user
curl -X POST http://localhost:8000/user
  • get specific user info (id and balance)
curl -X GET http://localhost:8000/user/2 # ← user id at the end. 2 is predefined
  • get list of items with prices and SKUs
curl -X GET http://localhost:8000/items
  • order items (provide SKUs from ↑)
curl -X POST \
  http://localhost:8000/order \
  -d '{
    "user": 2,
    "items": [
        {
            "sku": "c75ba722-4ad6-4fc3-afd1-ab88c0cf2b69",
            "quantity": 1
        },
        {
            "sku": "c5a79049-c6ac-4f9f-9005-01824cfd45fc",
            "quantity": 2
        }
    ],
    "shippingInfo": {
        "country": "nonUS",
        "city": "dfsdf",
        "address": "asdffd",
        "phone": "asdf",
        "name": "asdfasdf",
        "state": "asdf",
        "zip": "asdf",
        "region": null
    },
    "express": false
}'

or just load up api.postman_collection.json into Postman

no license

pf's People

Watchers

 avatar  avatar

pf's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.