Backend Projects
Backend Projects
Backend projects usually use one of two patterns:
cnos run -- <command>for zero-code-change adoptionimport cnos from '@kitsy/cnos'for direct runtime reads
For an existing Express or Node service that already uses .env, start with the env bridge:
cnos build env --profile local --to .env.localcnos build env --profile stage --to .env.stageThen keep your current dotenv setup while moving runtime reads to CNOS.
Example:
import cnos from '@kitsy/cnos';
await cnos.ready();
const port = cnos.value('server.port');const token = cnos.secret('app.token');Env export bridge:
cnos build env --to .env.localcnos build env --profile stage --to .env.stageProjection-first packaging:
cnos build server --profile prod --to .cnos-server.json