Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created November 12, 2020 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/d55e6f41095f350b3abbe8138fc15f56 to your computer and use it in GitHub Desktop.
Save bjoerntx/d55e6f41095f350b3abbe8138fc15f56 to your computer and use it in GitHub Desktop.
// serve static linked files (JavaScript and CSS for the editor)
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new Microsoft.Extensions.FileProviders.PhysicalFileProvider(
System.IO.Path.Combine(System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetEntryAssembly().Location),
"TXTextControl.Web")),
RequestPath = "/TXTextControl.Web"
});
// enable Web Sockets
app.UseWebSockets();
// attach the Text Control WebSocketHandler middleware
app.UseMiddleware<TXTextControl.Web.WebSocketMiddleware>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment