Make webview/websocket both work

Client code decides which one is used. Server code setup to handle both at same time.
This commit is contained in:
Kris De Volder
2019-08-28 09:46:47 -07:00
parent 9708319ea7
commit 9f2553f09a
4 changed files with 75 additions and 5 deletions

View File

@@ -27,7 +27,8 @@ import {VSCodeWebViewDiagramServer} from "./model";
export default function runStandalone() {
const clientId = getOptionFromDom('client-id') || 'sprotty-client';
const container = createContainer(TransportMedium.LSP, clientId);
const transport = getOptionFromDom('transport') || 'websocket';
const container = createContainer(transport=='websocket' ? TransportMedium.Websocket : TransportMedium.LSP, clientId);
const dispatcher = container.get<IActionDispatcher>(TYPES.IActionDispatcher);
// Run