docs: added dividers + see also section (#2899)
This commit is contained in:
@@ -8,6 +8,8 @@ To manage images in Medusa, you need a file service plugin responsible for hosti
|
||||
|
||||
Medusa provides three different options to handle your file storage. This document focuses on using [S3](https://aws.amazon.com/s3/) to store your Medusa server’s images.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Medusa Server
|
||||
@@ -18,6 +20,8 @@ A Medusa server is required to be set up before following along with this docume
|
||||
|
||||
You need to [create an AWS account](https://console.aws.amazon.com/console/home?nc2=h_ct&src=header-signin) to follow along with this documentation.
|
||||
|
||||
---
|
||||
|
||||
## Create S3 Bucket
|
||||
|
||||
On your AWS Console, search for S3 in the search box at the top. Then, choose the first result you see which should be S3 under the Services category.
|
||||
@@ -42,6 +46,8 @@ Then, in the “Block Public Access settings for this bucket” section, uncheck
|
||||
|
||||
You can leave the rest of the fields in the form as is and scroll down to the end of the page. Then, click on the Create Bucket button.
|
||||
|
||||
---
|
||||
|
||||
## Manage Bucket Policies
|
||||
|
||||
On the page of the bucket you just created, click on the Permissions tab. Then, scroll down until you find the Bucket policy section. Click on Edit in that section.
|
||||
@@ -80,6 +86,8 @@ Your user must have the `AmazonS3FullAccess` policy attached to it. You can refe
|
||||
|
||||
You must obtain access keys for your user as you’ll use them to integrate the S3 plugin in Medusa with your bucket. To obtain the Access Key ID and the Secret Access Key, check out [this guide](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys).
|
||||
|
||||
---
|
||||
|
||||
## Install the S3 Plugin
|
||||
|
||||
In the directory of your Medusa server, run the following command to install the S3 Plugin:
|
||||
@@ -157,6 +165,8 @@ If you have multiple storage plugins configured, the last plugin declared in the
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Test the S3 Plugin
|
||||
|
||||
Run your Medusa server with the following command:
|
||||
@@ -175,6 +185,8 @@ You can also check that the image was uploaded on the S3 bucket’s page.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Next.js Storefront Configuration
|
||||
|
||||
If you’re using a [Next.js](../starters/nextjs-medusa-starter.mdx) storefront, you need to add an additional configuration that adds the S3 bucket domain name into the configured images’ domain names. This is because all URLs of product images will be from the S3 bucket.
|
||||
@@ -201,8 +213,10 @@ module.exports = withStoreConfig({
|
||||
|
||||
Where `<BUCKET_NAME>` is the name of the S3 bucket you’re using.
|
||||
|
||||
## What’s Next
|
||||
---
|
||||
|
||||
## See Also
|
||||
|
||||
- Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store.
|
||||
- Learn how to [deploy the Medusa server](../deployments/server/index.mdx).
|
||||
- Learn about the [Next.js](../starters/nextjs-medusa-starter.mdx) and [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts.
|
||||
- [Deploy the Medusa server](../deployments/server/index.mdx)
|
||||
- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts.
|
||||
|
||||
Reference in New Issue
Block a user