A customer needs to search in a orderbook. He wants to buy offers below some price, and also sell offers to earn some money.
Returns json data about offers, based on one or more specific amounts. These results can also be sorted in ascending or descending order with an optional parameter.
- NodeJS (version >= 8).
npm install
npm start
npm test
-
URL /offer/:amounts/:sort?
-
URL Params
Required:
amounts=[float]
Optional:
sort=[string]
- Sample Calls:
$.ajax({
url: "/offer/80000/desc",
dataType: "json",
type : "GET",
success : function(r) {
console.log(r);
}
});
http://localhost:3000/offer/80000/desc
$.ajax({
url: "/offer/30000,20000/asc",
dataType: "json",
type : "GET",
success : function(r) {
console.log(r);
}
});