Closed saklanmaz closed 2 years ago
Hi @saklanmaz a simple example is shown below from the README. You have to define a default route.
using System.IO;
using System.Text;
using WatsonWebserver;
static void Main(string[] args)
{
Server server = new Server("127.0.0.1", 9000, false, DefaultRoute);
server.Start();
Console.ReadLine();
}
static async Task DefaultRoute(HttpContext ctx)
{
ctx.Response.StatusCode = 200;
await ctx.Response.Send("Hello from the default route!");
}
Then, open your browser to http://127.0.0.1:9000/.
I'm sorry, it was applied beautifully and simply, it escaped my notice. Thank you for the library.
Very glad to help @saklanmaz please let me know if anything else comes up! And thanks for the kind words.
Hi,
I am opening a server as below. With which activity can I listen to the requests coming to this server? How can I send a message from the server? Is it possible to assign
Received
function and send data like.Send()
as in SuperSimpleTcp?