UNPKG

strapi-plugin-media-prefix

Version:

Prepend media urls (images, files, audios, ) with your public url/media prefix on both Admin Panel and API's just in response without changing the relative path in database

15 lines (14 loc) 505 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = ({ strapi }) => { var _a; const plugin = strapi.plugin("media-prefix").service("mediaService"); (_a = strapi.db) === null || _a === void 0 ? void 0 : _a.lifecycles.subscribe({ afterFindOne(event) { event.result = plugin.addMediaPrefix(event.result); }, afterFindMany(event) { event.result = plugin.addMediaPrefix(event.result); }, }); };