From e33b09d878a915b927e69161e2e22c74c73abb0f Mon Sep 17 00:00:00 2001 From: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> Date: Thu, 28 Dec 2023 04:20:29 +0100 Subject: [PATCH] Better front page example --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3fa1ca5..c91cf80 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Simple, secure1 & standards compliant2 web server for the most demanding3 of applications. Read more...

- +

@@ -29,16 +29,21 @@ Designed around a convenient URL router with wildcard & parameter support - pair Start building your Http & WebSocket apps in no time; read the user manual and see examples. You can browse our TypeDoc for a quick overview. ```c++ +/* One app per thread; spawn as many as you have CPU-cores and let uWS share the listening port */ uWS::SSLApp({ /* These are the most common options, fullchain and key. See uSockets for more options. */ .cert_file_name = "cert.pem", .key_file_name = "key.pem" -}).get("/hello", [](auto *res, auto *req) { +}).get("/hello/:name", [](auto *res, auto *req) { /* You can efficiently stream huge files too */ - res->writeHeader("Content-Type", "text/html; charset=utf-8")->end("Hello HTTP!"); + res->writeStatus("200 OK") + ->writeHeader("Content-Type", "text/html; charset=utf-8") + ->write("

Hello ") + ->write(req->getParameter("name")) + ->end("!

"); }).ws("/*", {