lapis icon indicating copy to clipboard operation
lapis copied to clipboard

display "listening on ..." on startup

Open teto opened this issue 1 year ago • 2 comments

I am trying to run luarocks.org and when starting I see:

sudo lapis serve
[sudo] password for teto: 
nginx: [alert] lua_code_cache is off; this will hurt performance in /home/teto/luarocks-site/nginx.conf.compiled:38
nginx: [warn] duplicate MIME type "text/html" in /home/teto/luarocks-site/nginx.conf.compiled:97
nginx: [alert] lua_code_cache is off; this will hurt performance in /home/teto/luarocks-site/nginx.conf.compiled:196
2024/01/21 18:34:51 [notice] 671747#671747: using the "epoll" event method
2024/01/21 18:34:51 [notice] 671747#671747: openresty/1.21.4.1
2024/01/21 18:34:51 [notice] 671747#671747: built by gcc 12.3.0 (GCC) 
2024/01/21 18:34:51 [notice] 671747#671747: OS: Linux 6.7.0
2024/01/21 18:34:51 [notice] 671747#671747: getrlimit(RLIMIT_NOFILE): 32768:32768
2024/01/21 18:34:51 [notice] 671747#671747: start worker processes
2024/01/21 18:34:51 [notice] 671747#671747: start worker process 671775

would it make sense to display host:port the application is listening to to help newcomers ?

teto avatar Jan 21 '24 17:01 teto

Yes, I would love this even for myself. :) I always forget which ports I dedicate to which apps.

Was about to just drop at print statement at the end of our app.lua file, but do think it'd be nice for basically everyone.

cycomachead avatar Feb 16 '24 01:02 cycomachead

I agree that lapis server could output some help information about the used environment and configuration when using openresty. The only discrepancy is that with openresty, it uses the config, and the config may be listening on many/different ports separate from what is included in the environment configuration.

When using server with the cqueues server backend it currently outputs that information.

leafo avatar Feb 23 '24 21:02 leafo