# Configuration Guide ## Introduction This page describes the available configuration options for Mockdoor. Configuration can be done via environment variables or updating the appsettings.json files in the source code. ## Configuration Structure ``` "DeploymentConfiguration": { "PathBase": "/dev/mockdoor/", "SeedOnStartup": null, "ForceHttps": false, "Debug": false, "DebuggerUrl": "https://localhost:7275/dev/mockdoordebugger/debug/default/", "DatabaseConfig": { "Provider": 2, "ConnectionString": "Data Source=Data/mockdoor.debug.db;" } } ```
Above shows the configuration options available. To set them in an environment varaible use the format `"Parent__Child__Property=Value"` for example to set the `PathBase` to `"/test/path/"` you would put the environment variable `DeploymentConfiguration__PathBase=/test/path/"`. ## Docker example For docker you can set the environment variable using the `-e` argument when running the container. For example to run the container with the above configuration and also setting the `"SeedOnStartup=Data/DemoSampleData.json"` you would run the following command ``` docker run -d -p 44304:80 --name mockdoor -e DeploymentConfiguration__PathBase=/test/path/ -e DeploymentConfiguration__SeedOnStartup=Data/DemoSampleData.json" mockdoor/server ``` ## Configuration DetailsProperty | Environment Variable Path | Description | Example | Default |
---|---|---|---|---|
PathBase | DeploymentConfiguration\_\_PathBase | Sets a custom base path, this changes the path used to access Mockdoor. For example if /test/path/ is used then instead of accessing Mockdoor homepage at `https://localhost:44304` you access it from `https://localhost:44304/test/path/`. This is useful for when Mockdoor is behind a reverse proxy or in a K8 container and is not running on the base address. | `"/test/path/"` | `/` |
SeedOnStartup | DeploymentConfiguration\_\_SeedOnStartup | Sets a json database import file to import during startup. This must be added to the Mockdoor Server project in order to be accessible. There is a sample file under the Data folder called `DemoSampleData.json` | `Data/DemoSampleData.json` | `null` |
ForceHttps | DeploymentConfiguration\_\_ForceHttps | If true, this forces all request to Mockdoor to redirect to the https standard | `true` | `false` |
Debug | DeploymentConfiguration\_\_Debug | Sets if Mockdoor enables its additional debugging and diagnostics features. If true additional diagnostics page(s) will be enabled when errors occured. This can also affect the level of detail in some error messages in the UI | `true` | `true` when running in debug mode and `false` if not |
DebuggerUrl | DeploymentConfiguration\_\_DebuggerUrl | This is currently a unsupported feature that allows Mockdoor to send the Live feed feature to an external debugger application. This application has not been released as it does not add to Mockdoor anymore (since the Livefeed is now embedded). This may be improved and updated in the future but for now that makes this setting not useful. | `https://localhost:7275/debug/` | `null` |
Provider | DeploymentConfiguration\_\_DatabaseConfig\_\_Provider | Defines which database provider to use, 1 = Microsoft SQL Server, 2 = Sqlite | `1` | `null` |
ConnectionString | DeploymentConfiguration\_\_DatabaseConfig\_\_ConnectionString | The database connection string to use. Must be the correct format for the provider specified | `Data Source=Data/mockdoor.debug.db;` | `Data Source=Data/mockdoor.debug.db;` |