diff options
author | Stanley Yip <stanley_yip@brown.edu> | 2019-10-15 16:30:00 -0400 |
---|---|---|
committer | Stanley Yip <stanley_yip@brown.edu> | 2019-10-15 16:30:00 -0400 |
commit | 0be39316bd21939201ee0e15950cc7855c9c13ba (patch) | |
tree | bfec698f48c0545b0ce2105d7f17c16513316a68 /src/server/RouteSubscriber.ts | |
parent | aad42660123c227cbe2152fbbbc159f6a38fca17 (diff) | |
parent | 33811c112c7e479813908ba10f72813954a3e289 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into interaction_stanley
Diffstat (limited to 'src/server/RouteSubscriber.ts')
-rw-r--r-- | src/server/RouteSubscriber.ts | 26 |
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 |