tyfon init
tyfon build
tyfon serve
tyfon watch
tyfon install
tyfon uninstall
tyfon help
tyfon version
tyfon serve
storage Server-Side Command
alt_route Alias:
tyfon s
Serves the functions exported from index.ts
over network. Will reload the server
when code changes, and will call tyfon build
on the initial run if not built before
or if built using an older version of TyFON.
1link$tyfon serve
#
# 🚀 Serving exported functions on the netwrok ...
#
[INFO] 10:45:39 ts-node-dev ver. 1.0.0 (using ts-node ver. 9.0.0, typescript ver. 4.1.2)
my-tyfon-server listening at http://localhost:8000
👉 WILL NOT call tyfon build
on code change, so SDK metadata won't be updated! If you want to also
rebuild SDK metadata on code change, use tyfon watch.
You can specify the server port via -p
or --port
:
1link$tyfon serve -p 3000
#
# 🚀 Serving exported functions on the netwrok ...
#
[INFO] 10:45:39 ts-node-dev ver. 1.0.0 (using ts-node ver. 9.0.0, typescript ver. 4.1.2)
my-tyfon-server listening at http://localhost:3000
You can specify environment variables for the server process via -e
or --env
:
1link$tyfon s -e ENV=staging -e LOGS=/var/log/my-tyfon-server/
You can serve the code in production mode by specifying -m
or --mode
:
1link$tyfon s --mode prod
In production mode, the built JS code will be used and live-reload will be turned off.
Additionally, the TYFON_SERVE_MODE
environment variable will be set to whatever mode
you pass to --mode
for the server process.