sonamu.config.ts. You can configure project name, API paths, timezone, internationalization support, and more.
Basic Structure
projectName
Defines the name of the project. Displayed in logs, error messages, Sonamu UI, etc. Type:string (optional)
Default: SonamuProject if not set
Usage Example
api Settings
Defines basic API-related settings.api.dir
The directory name where API code is located. Type:string
Default: "api"
Most projects use
"api" as is. Keep the default unless there’s a specific reason to change it.api.route.prefix
Sets the common prefix for all API endpoints. Type:string
Default: "/api"
prefix: "/api":
UserModel.list→GET /api/user/listPostModel.detail→GET /api/post/detailOrderModel.create→POST /api/order/create
api.timezone
Sets the server’s default timezone. Affects date/time processing. Type:string (optional)
Default: System default
"Asia/Seoul"- Korea"America/New_York"- US Eastern"Europe/London"- UK"Asia/Tokyo"- Japan"UTC"- Coordinated Universal Time
i18n Settings
Internationalization (i18n) settings for multilingual support. Type:SonamuI18nOptions (optional)
Basic Configuration
defaultLocale
Sets the default language. Serves two roles:- Key definition basis: The language used as the standard when writing Entity’s
label,enumLabel, etc. - Runtime default: The language to use when the user doesn’t specify a locale
supportedLocales
List of all languages to support. Must includedefaultLocale.
Disabling i18n
If you don’t need multilingual support, simply omit thei18n setting:
Practical Examples
Basic Project Configuration
Using Environment Variables
Global Service
Next Steps
After completing basic project settings, proceed with these configurations:- database - Database connection settings
- server - Server options and plugin settings
- sync-targets - Frontend synchronization target settings