mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
* Move uWebSockets and uSockets forks into Bun's repository * Update Makefile * Update settings.json * Update libuwsockets.cpp * Remove backends we won't be using * Update bindings.cpp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
21 lines
566 B
C++
21 lines
566 B
C++
#include "App.h"
|
|
|
|
/* Note that uWS::SSLApp({options}) is the same as uWS::App() when compiled without SSL support */
|
|
|
|
int main() {
|
|
/* Overly simple hello world app */
|
|
uWS::SSLApp({
|
|
.key_file_name = "misc/key.pem",
|
|
.cert_file_name = "misc/cert.pem",
|
|
.passphrase = "1234"
|
|
}).get("/*", [](auto *res, auto */*req*/) {
|
|
res->end("Hello world!");
|
|
}).listen(3000, [](auto *listen_socket) {
|
|
if (listen_socket) {
|
|
std::cout << "Listening on port " << 3000 << std::endl;
|
|
}
|
|
}).run();
|
|
|
|
std::cout << "Failed to listen on port 3000" << std::endl;
|
|
}
|