Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 3383

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 61k
Author
Asked: November 26, 20242024-11-26T02:13:07+00:00 2024-11-26T02:13:07+00:00

First look at medusa-extender

  • 61k

As we have seen in the previous articles, medusa offers many fantastic customizable options.
However, sometimes we might even want to go beyond that, and that's precisely where medusa-extender comes in.

We can use medusa-extender to extend things out of the box more efficiently as it handles most of the logic.

In this article, we'll look at installing it and how to enable it in our project.

Installing medusa-extender

If you are following along, please ensure you have the medusa server setup.

From there, open your terminal, navigate to the project root, and run the following command.

npm i medusa-extender 
Enter fullscreen mode Exit fullscreen mode

From there, we can run the init function, which does all the heavy lifting.

./node_modules/.bin/medex init 
Enter fullscreen mode Exit fullscreen mode

This command will ensure all our packages are there. We are running the project in TypeScript mode and changing our package commands.

You'll also note a new modules folder is created in your src directory.
This contains some examples of a module/router and service.

By inspecting these files, we quickly learn that there are many cool things we can use out of the box.
For example, the router has a requiredAuth function built in.

We can quickly spool up our server in dev mode: npm start and check out this new route. (localhost:9000/admin/custom-route)

You can try and change the auth required to see the change from it being required, yes or no.

What can medusa-extender create?

Let's look at all the things medusa-extender can help us with.

  • Entity: Create a new entity representing a custom database row. We can even override existing ones
  • Repository: A whole repo to interact with custom entities
  • Migration: A migration file for managing our database
  • Service: To more easily create services, and we can even overwrite existing services
  • Middleware: With this, we can create custom middleware as, for example the logged-in user check
  • Router: Create custom routes quickly
  • Validator: A custom field validator, which is super handy for re-usable checks
  • Subscriber: Create a custom subscriber, but more easily with some more formatting
  • Module: A custom module that can incorporate multiple modules and components into one place.

In the coming articles, we'll look closely at some of these and how they will work.

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

beginnersjavascriptwebdev
  • 0 0 Answers
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    ES6 - A beginners guide - Template Literals

    • 0 Answers
  • Author

    Understanding Higher Order Functions in JavaScript.

    • 0 Answers
  • Author

    Build a custom video chat app with Daily and Vue.js

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.