diff --git a/package.json b/package.json index aafac97..5e59e45 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "eslint": "=1.10.3", "eslint-config": "git://github.com/dabapps/eslint-config.git", "eslint-plugin-react": "^3.11.3", + "jest-cli": "^0.8.1", "uglify-js": "=2.6.1" }, "dependencies": { diff --git a/src/api-requests.js b/src/api-requests.js new file mode 100644 index 0000000..178f33f --- /dev/null +++ b/src/api-requests.js @@ -0,0 +1,10 @@ +import * as request from 'superagent'; + +export default { + post: function (url, params) { + return request + .post(url) + .send(params) + .set('Accept', 'application/json'); + }, +}; diff --git a/src/app.js b/src/app.js index e69de29..fac88e4 100644 --- a/src/app.js +++ b/src/app.js @@ -0,0 +1,5 @@ +import apiRequest from './api-requests'; + +export default function (ident, callback, args, kwargs) { + return apiRequest.post('/reverse/', {ident, args, kwargs}); +};