* docs improvements and changes * updated module definition * modules + dml changes * fix build * fix vale error * fix lint errors * fixes to stripe docs * fix condition * fix condition * fix module defintion * fix checkout * disable UI action * change oas preview action * flatten provider module options * fix lint errors * add module link docs * pr comments fixes * fix vale error * change node engine version * links -> linkable * add note about database name * small fixes * link fixes * fix response code in api reference * added migrations step
108 lines
1.9 KiB
Plaintext
108 lines
1.9 KiB
Plaintext
import { Table } from "docs-ui"
|
|
|
|
export const metadata = {
|
|
title: `Local File Module Provider`,
|
|
}
|
|
|
|
# {metadata.title}
|
|
|
|
The Local File Module Provider stores files uploaded to your Medusa application in the `/uploads` directory.
|
|
|
|
---
|
|
|
|
## Install the Local File Module
|
|
|
|
<Note>
|
|
|
|
The Local File Module is installed by default in your application.
|
|
|
|
</Note>
|
|
|
|
To install the Local File Module Provider, run the following command in the directory of your Medusa application:
|
|
|
|
```bash npm2yarn
|
|
npm install @medusajs/file-local-next
|
|
```
|
|
|
|
Next, add the module into the `providers` array of the File Module:
|
|
|
|
<Note>
|
|
|
|
The File Module accepts one provider only.
|
|
|
|
</Note>
|
|
|
|
```js title="medusa-config.js"
|
|
import { Modules } from "@medusajs/utils"
|
|
|
|
// ...
|
|
|
|
module.exports = {
|
|
// ...
|
|
modules: {
|
|
[Modules.FILE]: {
|
|
resolve: "@medusajs/file",
|
|
options: {
|
|
providers: [
|
|
{
|
|
resolve: "@medusajs/file-local-next",
|
|
id: "local",
|
|
options: {
|
|
// provider options...
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
}
|
|
```
|
|
|
|
### Local File Module Options
|
|
|
|
<Table>
|
|
<Table.Header>
|
|
<Table.Row>
|
|
<Table.HeaderCell>Option</Table.HeaderCell>
|
|
<Table.HeaderCell>Description</Table.HeaderCell>
|
|
<Table.HeaderCell>Default</Table.HeaderCell>
|
|
</Table.Row>
|
|
</Table.Header>
|
|
<Table.Body>
|
|
<Table.Row>
|
|
<Table.Cell>
|
|
|
|
`upload_dir`
|
|
|
|
</Table.Cell>
|
|
<Table.Cell>
|
|
|
|
The directory to upload files to.
|
|
|
|
</Table.Cell>
|
|
<Table.Cell>
|
|
|
|
`uploads`
|
|
|
|
</Table.Cell>
|
|
</Table.Row>
|
|
<Table.Row>
|
|
<Table.Cell>
|
|
|
|
`upload_dir`
|
|
|
|
</Table.Cell>
|
|
<Table.Cell>
|
|
|
|
The URL of the Medusa application.
|
|
|
|
</Table.Cell>
|
|
<Table.Cell>
|
|
|
|
`http://localhost:9000`
|
|
|
|
</Table.Cell>
|
|
</Table.Row>
|
|
</Table.Body>
|
|
</Table>
|