diff options
author | bob <bcz@cs.brown.edu> | 2019-08-08 11:21:57 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-08-08 11:21:57 -0400 |
commit | e946f85b46e1b1a75ba46ccf9a1ee023e749b837 (patch) | |
tree | 13e6e489d10b7707a9e10fde87f399e396d506cd /src/Utils.ts | |
parent | 3110d85b7e1efab006a13824792b031f63dba8c8 (diff) | |
parent | 9776f0dbb1189105e5b947beb107203f4404c40c (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 11 |
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 |