diff --git a/docs/content/development/file-service/create-file-service.md b/docs/content/development/file-service/create-file-service.md index 88d8735426..44e8f71fa7 100644 --- a/docs/content/development/file-service/create-file-service.md +++ b/docs/content/development/file-service/create-file-service.md @@ -402,6 +402,30 @@ npx @medusajs/medusa-cli develop Then, try uploading a file, for example, using the [Upload File endpoint](/api/admin#tag/Uploads/operation/PostUploads). The file should be uploaded based on the logic you’ve implemented. +### (Optional) Accessing the File + +:::note + +This step is only useful if you're implementing a local file service. + +::: + +Since the file is uploaded to a local directory `uploads`, you need to configure a static route in express that allows accessing the files within the `uploads` directory. + +To do that, create the file `src/api/index.ts` with the following content: + +```ts +import express from "express" + +export default () => { + const app = express.Router() + + app.use(`/uploads`, express.static(uploadDir)) + + return app +} +``` + --- ## See Also