Update configuration.mdx

This commit is contained in:
dumbutdumber 2025-09-25 12:58:58 +05:30 committed by GitHub
parent 704fbee8b0
commit c0984002a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,20 +4,44 @@ title: 'Configuration'
# Backend Config Reference # Backend Config Reference
The backend can be configured using: The backend can be configured in 3 different ways:
- Make a `config.json` file in the working directory of the application (root of repository)
- Make a `.env` file in the working directory of the application (root of repository)
- Add environment variables to your system (or container) - Add environment variables to your system (or container)
These different config options are all mutually inclusive, so you can use multiple at the same time if you want to.
<Warning> <Warning>
With any of these configurations, you have to have atleast three variables set With any of these configurations, you have to have atleast three variables set
for the server to function: [`DATABASE_URL`](#postgres-connection-⚠), for the server to function: [`postgres.connection`](#postgres-connection-⚠),
[`CRYPTO_SECRET`](#crypto-session-secret-⚠) and [`crypto.sessionSecret`](#crypto-session-secret-⚠) and
[`META_NAME`](#meta-name-⚠) [`meta.name`](#meta-name-⚠)
</Warning> </Warning>
### Method - Environment ### Method 1 - `config.json`
You add the variables to the environment. This method uses nesting, so the key `server.basePath` with the value of `"/backend"` will result in a file that looks like this:
```json
{
"server": {
"basePath": "/backend"
}
}
```
### Method 2 - `.env`
The environment variable names use double underscores as separators and `MWB_` as the prefix. So the key `server.basePath` will result in the .env file like this:
```sh
MWB_SERVER__BASE_PATH=/backend
```
### Method 3 - Environment
This method is identical to the `.env` method listed above, but you add the variables to the environment instead of writing it in a file.
# Reference # Reference