Skip to content

Commit

Permalink
user server url has meaning outside of binder
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejpurves committed Sep 4, 2023
1 parent b36c7c2 commit 77137d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions packages/core/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ThebeServer implements ServerRuntime, ServerRestAPI {
serviceManager?: ServiceManager; // jlite only
repoProviders?: RepoProviderSpec[];
binderUrls?: BinderUrlSet;
userServerUrl?: string;
private resolveReadyFn?: (value: ThebeServer | PromiseLike<ThebeServer>) => void;
private _isDisposed: boolean;
private events: EventEmitter;
Expand Down Expand Up @@ -200,6 +201,7 @@ class ThebeServer implements ServerRuntime, ServerRestAPI {

// Resolve the ready promise
return this.sessionManager.ready.then(() => {
this.userServerUrl = `${serverSettings.baseUrl}?token=${serverSettings.token}`;
this.events.triggerStatus({
status: ServerStatusEvent.ready,
message: `Server connection ready`,
Expand Down Expand Up @@ -242,6 +244,7 @@ class ThebeServer implements ServerRuntime, ServerRestAPI {
});

return this.sessionManager?.ready.then(() => {
this.userServerUrl = `${serviceManager.serverSettings.baseUrl}?token=${serviceManager.serverSettings.token}`;
this.events.triggerStatus({
status: ServerStatusEvent.ready,
message: `Server connection established`,
Expand Down Expand Up @@ -394,11 +397,7 @@ class ThebeServer implements ServerRuntime, ServerRestAPI {
// so we can await here
await this.sessionManager.ready;

this.binderUrls = {
build: urls.build,
launch: urls.launch,
userServer: `${msg.url}?token=${msg.token}`,
};
this.userServerUrl = `${msg.url}?token=${msg.token}`;

state.status = ServerStatusEvent.ready;
this.events.triggerStatus({
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export interface RepoProviderSpec {
export interface BinderUrlSet {
build: string;
launch: string;
userServer?: string;
}

export type WellKnownRepoProvider = 'git' | 'github' | 'gitlab' | 'gist';
Expand Down

0 comments on commit 77137d5

Please sign in to comment.