JSPM

@medusajs/file-local

1.0.2-canary-20230824093346
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 22620
  • Score
    100M100P100Q122618F
  • License MIT

Local file plugin for Medusa

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@medusajs/file-local) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Local file storage

    Store uploaded files to your Medusa backend locally.

    Not suited for production environments

    Plugin Documentation | Medusa Website | Medusa Repository

    Features

    • Store product images locally

    Prerequisites


    How to Install

    1. Run the following command in the directory of the Medusa backend:

    npm install @medusajs/file-local

    2 . In medusa-config.js add the following at the end of the plugins array:

    const plugins = [
      // ...
      {
        resolve: `@medusajs/file-local`,
        options: {
          upload_dir: 'uploads/images', // optional
          backend_url: 'http://localhost:9000' // optional
        }
      },
    ]

    Test the Plugin

    1. Run the following command in the directory of the Medusa backend to run the backend:

    npm run start

    2. Upload an image for a product using the admin dashboard or using the Admin APIs.