Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.3 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.3 KB

❗ Update (v0.1.3) ❗:

This is no longer maintained, as there is an official package for local filestorage now: @medusajs/file-local.


Local filestorage Medusa plugin

This repo provides the plugin to get you started serving images using your filesystem. Follow the steps below to get ready. Store your images locally on your installation of Medusa e-commerce.

Adding plugin to Medusa.js Core

  1. Download the package
npm install medusa-plugin-filestorage-local
pnpm install medusa-plugin-filestorage-local
yarn add medusa-plugin-filestorage-local
  1. Register it in the medusa-config.js

Default configuration

const plugins = [
  ...
  {
    resolve: "medusa-plugin-filestorage-local",
    options: {
      // The baseurl for your medusajs server
      serverBaseUrl: process.env.MEDUSA_BACKEND_URL || "http://localhost:9000",
      // when enabled saves the file as a base64 encoded string inside the database (deleting that row is not yet supported)
      saveInDatabase: false, // recommended: false
      // the folder where your files are stored on the server
      fileLocation: "uploads/persistent/",
    }
  },
  ...
]