Mercurial Hosting > luan
view src/luan/modules/http/serve.luan @ 1756:a4b232aa0554
serve.luan - allow extra args
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Feb 2023 22:08:50 -0700 |
parents | af22d6c120e4 |
children |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local Io = require "luan:Io.luan" local Server = require "luan:http/Server.luan" local String = require "luan:String.luan" local to_number = String.to_number or error() local dir, port = ... if dir==nil then Io.stderr.write "usage: luan luan:http/serve.luan dir [port]\n" return end if port ~= nil then port = to_number(port) or error "port must be an integer" end Server.serve(dir,port)