Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Correct module path and clarify config structure in Medusa v2 Docs #9222

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions www/apps/book/app/basics/modules-and-services/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ The last step is to add the module in Medusa’s configurations.

In `medusa-config.js`, add a `modules` property and pass to it your custom module:

```js title="medusa-config.js" highlights={[["4", "helloModuleService", "The key of the main service to be registered in the Medusa container."]]}
```js title="medusa-config.js" highlights={[["7", "helloModuleService", "The key of the main service to be registered in the Medusa container."]]}
module.exports = defineConfig({
// ...
projectConfig: {
// ...
},
modules: {
helloModuleService: {
resolve: "./modules/hello",
Expand Down Expand Up @@ -109,8 +111,8 @@ For example, create the API route `src/api/custom/route.ts` with the following c

```ts title="src/api/custom/route.ts"
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
import HelloModuleService from "../../../modules/hello/service"
import { HELLO_MODULE } from "../../../modules/hello"
import HelloModuleService from "../../modules/hello/service"
import { HELLO_MODULE } from "../../modules/hello"

export async function GET(
req: MedusaRequest,
Expand Down
Loading