From 9625876e2a9c0c5b396c6e015ea12af62b345c4d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 17 Dec 2015 18:21:19 +0000 Subject: [PATCH] Added basic codebase --- package.json | 1 + src/api-requests.js | 10 ++++++++++ src/app.js | 5 +++++ 3 files changed, 16 insertions(+) create mode 100644 src/api-requests.js 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}); +};