bunbun.dev/server.fnl
2024-05-20 20:23:38 -07:00

17 lines
324 B
Fennel

(local socket (require :socket))
(local handle-client (. (require :client-handler) :handle-client))
(local port 8080)
(local server (socket.tcp))
(server:bind "*" port)
(server:listen)
(while true
(local client (server:accept))
(local co (coroutine.create (fn [] (handle-client client))))
(coroutine.resume co))