nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.37k stars 323 forks source link

[unitctl] Support system filewatcher for restart command #1437

Open 4141done opened 1 week ago

4141done commented 1 week ago

This is a feature request!

Can unitctl enable an "auto reload" workflow for app development without additional scripting?

When I'm working on a Phoenix application (I'm aware the underlying language is not supported - just giving an example of the experience). Basic flow is:

  1. Start the server mix phx.server
  2. Initial compile and serve
  3. The process lets me know it is watching for changes
  4. Change something in one of the source files
  5. Rebuild, I can now interact with my application and it will reflect the latest changes.

There are some caveats - certain files to require a full restart based on framework minutiae.

Example output:

Compiling 14 files (.ex)
Generated bloopsy app
[info] Running BloopsyWeb.Endpoint with Bandit 1.5.7 at 127.0.0.1:4000 (http)
[info] Access BloopsyWeb.Endpoint at http://localhost:4000
[debug] Downloading esbuild from https://registry.npmjs.org/@esbuild/darwin-arm64/0.17.11

Rebuilding...

Done in 320ms.
[watch] build finished, watching for changes...
# I made a change here
Rebuilding...

Done in 72ms.

It would be cool if I could follow a similar workflow with unitctl where it finds the system filewatcher and watches project files.