Created
July 29, 2015 16:28
-
-
Save jsloyer/e5a953cf5691a4aeefc2 to your computer and use it in GitHub Desktop.
business rules example app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var app = require("express")(), | |
| restler = require("restler"); | |
| app.get("/", function(request, response) { | |
| var json = { | |
| "employeeID": "jujuju", | |
| "loanAmount": 10517320, | |
| "theEmployee": { | |
| "seniority": 3, | |
| "annualSalary": 10517320, | |
| "nbOfExtraVacationDaysBasedOnSeniority": 10517320 | |
| }, | |
| "creditAmount": 20000, | |
| "__DecisionID__": "string", | |
| "AnnualSalary": 20000 | |
| }; | |
| var options = { | |
| username: "replaceme", | |
| password: "replaceme" | |
| }; | |
| var url = "https://brsv2-6855bc66.ng.bluemix.net/DecisionService/rest" + "/vacationsRuleApp/1.0/vacationsRuleProject/json"; | |
| restler.postJson(url, json, options).on('complete', function(data) { | |
| response.send(data); | |
| }); | |
| }); | |
| app.listen(process.env.VCAP_APP_PORT || 8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment