Concepts
CLI
Legonode command line interface: dev, build, and start.
CLI
Legonode provides three main commands:
legonode dev
Runs your app with hot reload. It watches:
- route files (
route.*orget/post/put/...*.route.*) middleware.*- cron files (
*.cron.*) undercron/ - event files (
*.event.*) underevents/
legonode build
Compiles TypeScript sources into the build output directory (default ./dist).
legonode start
Starts the built app (no hot reload).
Common options
-p, --port <number>: server port (default from config or3000)-H, --host <string>: server host (default127.0.0.1)--appDir <path>: app directory root (overrideslegonode.config.ts)--build-path <path>: output dir forbuild/start(default./dist)
Plugin command hooks
If you configure plugins in legonode.config.ts, plugins can also react to CLI lifecycle via hooks like:
onDevStart,onDevFileChange,onDevRestart,onDevStoponBuildStart,onBuildComplete,onBuildErroronStartStart,onStartListening,onStartStop,onStartError