Giter Site home page Giter Site logo

store-server's Introduction

store-server

This is the main program that runs the prototype store. It is a single jar that handles both HTTP and Websocket APIs. Per our architecture design, this applicaiton handles both load balancing and higher level database functionnality internally.

How to build

You need Java 7 and leiningen on your machine to make the jar.

lein uberjar
docker build -t aircart/store-server .

How to run

Add -p 8080:8080 if you want to test the api over an unsecure connection, otherwise use with ssl-proxy.

docker run --name api aircart/store-server

Devices API Documentation

For API doc, go to: http://docs.aircart.apiary.io/

Seeding Web Commands

Seed cart

curl http(s)://host:port/seeding/cart/[user-id]/[cart-name]

This will seed the given cart-name to user-id. Example:

curl http://tariks-air:8080/seeding/cart/1031864300/web

will give Joe the same cart as on Aircart's homepage.

Seed payment cards

curl http(s)://host:port/seeding/cards/[user-id]/[stripe-id]

This will give this user all the credit cards associated with the given Stripe customer ID. Example:

curl http://tariks-air:8080/seeding/cards/1031864300/cus_2HF3vQgQKy5aIo

will (re)connect Joe's Stripe account to his Aircart account, he will hence see all his credit cards appear again, in case the Aircart database was reset.

store-server's People

Contributors

tarikjn avatar

Watchers

 avatar  avatar  avatar

Forkers

hdinh

store-server's Issues

Server crashes when scanning foreign QR code

Server crashes after scanning and retrieving a cart with a foreign QR code (GET /cart):

Sun Sep 08 17:36:41 CDT 2013 [worker-2] ERROR - GET /cart
java.lang.RuntimeException: Invalid token: :http://supportforums.blackberry.com/t5/Java-Development/How-to-use-the-Barcode-API/ta-p/574569
    at clojure.lang.Util.runtimeException(Util.java:219)
    at clojure.lang.LispReader.interpretToken(LispReader.java:326)
    at clojure.lang.LispReader.read(LispReader.java:211)
    at clojure.lang.LispReader.readDelimitedList(LispReader.java:1157)
    at clojure.lang.LispReader$MapReader.invoke(LispReader.java:1091)
    at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148)
    at clojure.lang.LispReader$MapReader.invoke(LispReader.java:1091)
    at clojure.lang.LispReader.read(LispReader.java:185)
    at clojure.lang.RT.readString(RT.java:1738)
    at clojure.core$read_string.invoke(core.clj:3427)
    at store_server.models.cart$fetch_with_cib.invoke(cart.clj:56)
    at store_server.models.cart$fetch.invoke(cart.clj:66)
    at store_server.controllers.carts$get_current_cart.invoke(carts.clj:14)
    at store_server.web$load_with_descriptor$fn__309$fn__310.invoke(web.clj:63)
    at store_server.controllers.helpers$with_authentication.invoke(helpers.clj:9)
    at store_server.web$load_with_descriptor$fn__309.invoke(web.clj:62)
    at compojure.core$make_route$fn__342.invoke(core.clj:93)
    at compojure.core$if_route$fn__330.invoke(core.clj:39)
    at compojure.core$if_method$fn__323.invoke(core.clj:24)
    at compojure.core$routing$fn__348.invoke(core.clj:106)
    at clojure.core$some.invoke(core.clj:2443)
    at compojure.core$routing.doInvoke(core.clj:106)
    at clojure.lang.RestFn.applyTo(RestFn.java:139)
    at clojure.core$apply.invoke(core.clj:619)
    at compojure.core$routes$fn__352.invoke(core.clj:111)
    at ring.middleware.json$wrap_json_params$fn__388.invoke(json.clj:33)
    at ring.middleware.json$wrap_json_response$fn__394.invoke(json.clj:42)
    at store_server.web$simple_logging_middleware$fn__279.invoke(web.clj:26)
    at clojure.lang.Var.invoke(Var.java:415)
    at org.httpkit.server.HttpHandler.run(RingHandler.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

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.