UNPKG

@nurielmeni/strapi-plugin-video-field

Version:
67 lines (66 loc) 1.18 kB
const bootstrap = ({ strapi }) => { }; const destroy = ({ strapi }) => { }; const name = "@nurielmeni/strapi-plugin-video-field"; const pluginPkg = { name }; const PLUGIN_ID = pluginPkg.name.replace(/^(@nurielmeni\/strapi-)plugin-/i, ""); const register = ({ strapi }) => { strapi.customFields.register({ name: "video", plugin: PLUGIN_ID, type: "json" }); }; const config = { default: {}, validator() { } }; const contentTypes = {}; const controller = ({ strapi }) => ({ index(ctx) { ctx.body = strapi.plugin("video-field").service("service").getWelcomeMessage(); } }); const controllers = { controller }; const middlewares = {}; const policies = {}; const routes = [ { method: "GET", path: "/", // name of the controller file & the method. handler: "controller.index", config: { policies: [] } } ]; const service = ({ strapi }) => ({ getWelcomeMessage() { return "Welcome to Strapi 🚀"; } }); const services = { service }; const index = { register, bootstrap, destroy, config, controllers, routes, services, contentTypes, policies, middlewares }; export { index as default };