Skip to content

Commit d28f9f0

Browse files
committed
Fix linux path compatibility
1 parent d431296 commit d28f9f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Webservers/Webservers.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using EmbedIO.WebSockets;
77
using System.Threading.Tasks;
88
using EmbedIO.Files;
9+
using System.IO;
910

1011
namespace WebsocketServer
1112
{
@@ -36,7 +37,7 @@ public override void OnEngineInit()
3637
private void startWebServer()
3738
{
3839
var url = "http://localhost:8080/";
39-
var cwd = System.IO.Directory.GetCurrentDirectory();
40+
var cwd = Directory.GetCurrentDirectory();
4041
Msg(cwd);
4142

4243
var server = new WebServer(o => o
@@ -48,7 +49,7 @@ private void startWebServer()
4849
.WithModule(new WebSocketsChatServer("/chat"))
4950
.WithModule(new WebSocketsChatEchoServer("/chat-echo"))
5051
.WithModule(new WebSocketsChatIdServer("/chat-id"))
51-
.WithStaticFolder("/", cwd + "\\Webserver", true, m => m
52+
.WithStaticFolder("/", Path.Combine(cwd, "Webserver"), true, m => m
5253
.WithContentCaching(false)) // Add static files after other modules to avoid conflicts
5354
.WithModule(new ActionModule("/", HttpVerbs.Any, ctx => ctx.SendDataAsync(new { Message = "Error" })));
5455

0 commit comments

Comments
 (0)