mirror of
https://codeberg.org/bunbun/bunbun.dev
synced 2025-01-22 12:44:29 -08:00
17 lines
324 B
Fennel
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))
|