chore: reorganize docs apps (#7228)

* reorganize docs apps

* add README

* fix directory

* add condition for old docs
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-05-03 17:36:38 +03:00
1 parent 224ebb2154
commit 4fe28f5a95
6187 files changed
+601447 -598226

No files matched your search

@@ -0,0 +1,38 @@
import { TypeList } from "docs-ui"
# ConfigModule
The configurations for your Medusa backend are in `medusa-config.js` located in the root of your Medusa project. The configurations include database, modules, and plugin configurations, among other configurations.
`medusa-config.js` exports an object having the following properties:
- [projectConfig](page.mdx#projectconfig): (required): An object that holds general configurations related to the Medusa backend, such as database or CORS configurations.
- [plugins](page.mdx#plugins): An array of plugin configurations that defines what plugins are installed and optionally specifies each of their configurations.
- [modules](page.mdx#modules): An object that defines what modules are installed and optionally specifies each of their configurations.
- [featureFlags](page.mdx#featureflags): An object that enables or disables features guarded by a feature flag.
For example:
```js title="medusa-config.js"
module.exports = {
projectConfig,
plugins,
modules,
featureFlags,
}
```
---
## Environment Variables
It's highly recommended to store the values of configurations in environment variables, then reference them within `medusa-config.js`.
During development, you can set your environment variables in the `.env` file at the root of your Medusa backend project. In production,
setting the environment variables depends on the hosting provider.
---
## Properties
<TypeList types={[{"name":"projectConfig","type":"[ProjectConfigOptions](../medusa.ProjectConfigOptions/page.mdx)","description":"This property holds essential configurations related to the Medusa backend, such as database and CORS configurations.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"database_logging","type":"`LoggerOptions`","description":"This configuration specifies what database messages to log. Its value can be one of the following:\n\n- (default) A boolean value that indicates whether any messages should be logged.\n- The string value `all` that indicates all types of messages should be logged.\n- An array of log-level strings to indicate which type of messages to show in the logs. The strings can be `query`, `schema`, `error`, `warn`, `info`, `log`, or `migration`. Refer to [Typeorm’s documentation](https://typeorm.io/logging#logging-options) for more details on what each of these values means.\n\nIf this configuration isn't set, its default value is `false`, meaning no database messages are logged.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"store_cors","type":"`string`","description":"The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n`store_cors` is a string used to specify the accepted URLs or patterns for store API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, `http://localhost:8000`. The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\\1([gimsuy]*)$`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"admin_cors","type":"`string`","description":"The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n`admin_cors` is a string used to specify the accepted URLs or patterns for admin API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, `http://localhost:7001`. The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\\1([gimsuy]*)$`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_cors","type":"`string`","description":"The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n`auth_cors` is a string used to specify the accepted URLs or patterns for API Routes starting with `/auth`. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, `http://localhost:7001`. The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\\1([gimsuy]*)$`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cookie_secret","type":"`string`","description":"A random string used to create cookie tokens. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set, the default secret is `supersecret` However, in production, if this configuration is not set, an error is thrown and\nthe backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"jwt_secret","type":"`string`","description":"A random string used to create authentication tokens. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set the default secret is `supersecret` However, in production, if this configuration is not set an error, an\nerror is thrown and the backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"database_database","type":"`string`","description":"The name of the database to connect to. If specified in `database_url`, then it’s not required to include it.\n\nMake sure to create the PostgreSQL database before using it. You can check how to create a database in\n[PostgreSQL's documentation](https://www.postgresql.org/docs/current/sql-createdatabase.html).","optional":true,"defaultValue":"","exLine truncated