aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-08-09 11:05:42 -0400
committerkimdahey <claire_kim1@brown.edu>2019-08-09 11:05:42 -0400
commitc407983788a09a5f93921439390834a4811b8842 (patch)
treeb757999bda24e13269608a6c63f116e55a702ba7 /src/Utils.ts
parent46637dc8f902077d613b737f576b755545a92c17 (diff)
parent68f613b5e762649b743059e494e9307eb103ff0d (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into tree_claire
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index bad875f0d..959b89fe5 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -3,6 +3,7 @@ import v5 = require("uuid/v5");
import { Socket } from 'socket.io';
import { Message } from './server/Message';
import { RouteStore } from './server/RouteStore';
+import requestPromise = require('request-promise');
export class Utils {
@@ -175,4 +176,14 @@ export namespace JSONUtils {
return results;
}
+}
+
+export function PostToServer(relativeRoute: string, body: any) {
+ let options = {
+ method: "POST",
+ uri: Utils.prepend(relativeRoute),
+ json: true,
+ body: body
+ };
+ return requestPromise.post(options);
} \ No newline at end of file