aboutsummaryrefslogtreecommitdiff
path: root/src/server/RouteSubscriber.ts
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-11-03 17:07:18 -0500
committerkimdahey <claire_kim1@brown.edu>2019-11-03 17:07:18 -0500
commitb1e9619a4e04a9784d927c766361d734f549d6c5 (patch)
tree36b875ccc0c45c3706d2533c4c28cc1492b38ce5 /src/server/RouteSubscriber.ts
parentb2777f92b50f926357ad9b595c7907368b996fbd (diff)
parent2786a2e4b33ff874f320697b89fecec3105df201 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into webcam_mohammad
Diffstat (limited to 'src/server/RouteSubscriber.ts')
-rw-r--r--src/server/RouteSubscriber.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/server/RouteSubscriber.ts b/src/server/RouteSubscriber.ts
new file mode 100644
index 000000000..e49be8af5
--- /dev/null
+++ b/src/server/RouteSubscriber.ts
@@ -0,0 +1,26 @@
+export default class RouteSubscriber {
+ private _root: string;
+ private requestParameters: string[] = [];
+
+ constructor(root: string) {
+ this._root = root;
+ }
+
+ add(...parameters: string[]) {
+ this.requestParameters.push(...parameters);
+ return this;
+ }
+
+ public get root() {
+ return this._root;
+ }
+
+ public get build() {
+ let output = this._root;
+ if (this.requestParameters.length) {
+ output = `${output}/:${this.requestParameters.join("/:")}`;
+ }
+ return output;
+ }
+
+} \ No newline at end of file