Skip to content

Commit 6fa7520

Browse files
authored
Update README.md
1 parent 9002467 commit 6fa7520

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,31 @@ Your site is now running at http://localhost:8000!
9999
Edit `/pages/index.tsx` to see your site update in real-time!
100100

101101
# Product Module
102-
> The Product Module is currently in beta. You can learn more about it [here](https://docs.medusajs.com/modules/products/serverless-module). In addition, the product module in the Next.js storefront can't be used without the Medusa backend at the moment.
102+
> The Product Module is currently in beta. You can learn more about it [here](https://docs.medusajs.com/modules/products/serverless-module). In addition, the product module in the Next.js storefront can't be used without the Medusa backend running at the moment.
103103
104104
This starter has full support for our new serverless [Product Module](https://docs.medusajs.com/modules/products/serverless-module) for retrieving and manipulating product data directly from a serverless function. This keeps your product logic close to the frontend, making it easy to customize or extend Medusa's core functionality from within your Next.js project.
105105

106-
By default, this starter uses the standard Medusa API for product and collection retrieval. To enable the Product Module, follow these steps:
106+
By default, this starter uses the standard Medusa API for product and collection retrieval. To enable the Product Module, first, make sure to set the following environment variables:
107107

108-
1. Make sure the `PRODUCT_POSTGRES_URL` and `NEXT_PUBLIC_BASE_URL` environment variables are set properly.
109-
2. In `store.config.json`, set the `productModule` feature flag to `true` and save the file.
110-
3. Restart the dev server.
108+
- `PRODUCT_POSTGRES_URL`: the URL of your PostgreSQL databsae.
109+
- `NEXT_PUBLIC_BASE_URL`: the URL of your storefront's base URL. If you're running it locally, it should be http://localhost:8000.
110+
111+
Then, enable the productModule feature flag in `./store.config.json`:
112+
113+
```javascript
114+
{
115+
"features": {
116+
// other features...
117+
"productModule": true
118+
}
119+
}
120+
```
121+
122+
Make sure the Medusa backend is running, then start (or restart) your Next.js storefront.
111123

112124
Done! All product and collection data should now be coming from the module. The Product Module routes are all in `src/app/api` for you to edit and play around with.
113125

114-
To opt out of using the module, simply set the feature flag to `false` and restart the server.
126+
To opt out of using the product module, simply set the `productModule` feature flag to `false` and restart the server.
115127

116128
# Payment integrations
117129

@@ -133,9 +145,10 @@ You will also need to setup the integrations in your Medusa server. See the [Med
133145

134146
This starter is configured to support using the `medusa-search-meilisearch` plugin out of the box. To enable search you will need to enable the feature flag in `./store-config.json`, which you do by changing the config to this:
135147

136-
```json
148+
```javascript
137149
{
138150
"features": {
151+
// other features...
139152
"search": true
140153
}
141154
}

0 commit comments

Comments
 (0)