@nurielmeni/strapi-plugin-video-field
Version:
Add video field to your Strapi application.
66 lines (65 loc) • 1.19 kB
JavaScript
;
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
};
module.exports = index;