Configuration
Use .env to change how the App runs. Use .goforj.yml to select components and configure the development loop.
Change a Runtime Setting
In the Project from Quickstart, stop forj dev and set the default App's HTTP port in .env.
API_HTTP_PORT=3001Start only the HTTP runtime.
forj apiIn another terminal, verify the listener returns 200 on the new port.
curl -fsS -o /dev/null -w '%{http_code}\n' http://localhost:3001/-/health
# 200The HTTP runtime reads the port at startup. Restart it after changing that value. For a running deployment, use maintenance mode to pause HTTP traffic through the live control commands.
Choose the Right Layer
| Change | Owner | What to do next |
|---|---|---|
| Port, URL, secret, active driver, or connection value | .env or process environment | Restart the affected process. |
| Supported driver set or named generated resource | Environment configuration plus generated code | Run forj build, then restart. |
| Selected component, starter kit, additional App, or render option | .goforj.yml | Render or build as directed by the feature guide. |
| Local build, runtime, or watch command | .goforj.yml under dev.apps or dev.watches | Restart forj dev. |
Edit Local Environment
Keep local values and secrets in .env or .env.host. A full render regenerates .env.local. Commit .env.example as the key inventory and .env.testing as the test profile. Process environment variables take precedence. See Environment File Resolution for the exact load order and behavior.
forj dev and forj build initialize a missing .env from .env.example and generate fresh local values for framework signing and diagnostic keys. Use the hidden prompt to enter a local secret.
forj env:set DISCORD_TOKENThe next build adds the new key to the committed files with a blank value. Add safe shared defaults directly to .env.example. Run forj env:check in CI and review changes to committed environment files for secrets. The Configuration Reference also covers upgrades from an unmanaged .env.testing.
Select a Driver
With the cache component enabled, set its supported drivers and choose one at startup.
CACHE_SUPPORTED_DRIVERS=memory,redis
CACHE_DRIVER=memoryCACHE_SUPPORTED_DRIVERS determines which cache drivers are compiled into the app. CACHE_DRIVER chooses one of those drivers at startup.
Restart after changing CACHE_DRIVER to a driver already compiled into the App. Run the build when you change CACHE_SUPPORTED_DRIVERS so GoForj can update the generated imports.
forj buildThe same pattern applies to storage, queues, events, mail, and databases. See Environment Reference for the complete contract.
Change the Project
Keep the Project's existing components when you enable another one. For example, this configuration adds scheduler to the SQLite App.
render:
components: [cli, web_api, database_sqlite, scheduler]Follow Task Scheduling to apply the change and register a task. See Local Development to configure which commands run under forj dev.
When to Rebuild or Restart
forj dev rebuilds and restarts configured Apps when it sees relevant source or environment changes. Restart the development loop after changing its own command configuration. Use forj build to rebuild explicitly outside that loop. Build the App explains which changes affect compiled code.
Next Steps
- Configuration Reference lists
.goforj.yml, environment resolution, and build-time configuration behavior. - Environment Reference lists every public environment variable.
- forj dev explains local build, frontend, runtime, and custom-watch lifecycles.
- Build the App explains generated ownership and rebuild boundaries.