mirror of
https://github.com/lune-org/lune.git
synced 2025-04-11 22:10:53 +01:00
Expose ip and port in serve handle
This commit is contained in:
parent
53da0758e5
commit
b526ccab9a
1 changed files with 2 additions and 0 deletions
|
@ -340,6 +340,8 @@ pub async fn serve<'lua>(
|
||||||
});
|
});
|
||||||
|
|
||||||
TableBuilder::new(lua)?
|
TableBuilder::new(lua)?
|
||||||
|
.with_value("ip", addr.ip().to_string())?
|
||||||
|
.with_value("port", addr.port())?
|
||||||
.with_function("stop", move |lua, _: ()| match shutdown_tx.send(true) {
|
.with_function("stop", move |lua, _: ()| match shutdown_tx.send(true) {
|
||||||
Ok(_) => Ok(()),
|
Ok(_) => Ok(()),
|
||||||
Err(_) => Err(LuaError::runtime("Server already stopped")),
|
Err(_) => Err(LuaError::runtime("Server already stopped")),
|
||||||
|
|
Loading…
Add table
Reference in a new issue