Where Does Hanami Store Config and Slices?
Hanami 2 keeps app config in config/app.rb with routes, settings, and slices beside it, plus .env files for secrets per environment.
Last updated
Hanami 2 structures apps around config/ with app.rb, routes, and settings files declaring behavior. Slices modularize domains with their own configs while sharing the root setup. Environment files inject secrets per deploy.
That layout keeps configuration discoverable without magic locations. Routes, settings, and initializers read top down at boot. New checkouts configure from committed files plus a copied env example.
Where Hanami stores this, by platform
config/app.rb + .env
App settings plus routes and slices config versioned per project. Env files inject secrets per deploy. Structure stays conventional.
config/app.rb + .env
Same conventional layout on Mac installs. Slices modularize domains independently. Copy env examples for new setups.
config\app.rb + .env
Windows projects mirror the identical structure. Secrets never commit. Boot reads config top down.
Frequently asked questions
Where is Hanami configured?
Edit config/app.rb for base settings with environment files overriding per deploy. Slices carry their own configs for modular monoliths. Keep secrets in .env out of git.
How are Hanami slices organized?
Organize code into slices under slices/ each with config, actions, and views. Shared pieces live in app/ at root. The config tree wires slices together at boot.
Notice an outdated path? Let us know.