diff --git a/modules/link/module.js b/modules/link/module.js new file mode 100644 index 0000000..bdc8d52 --- /dev/null +++ b/modules/link/module.js @@ -0,0 +1,23 @@ +const Joi = require("joi"); + +// Redirects the user to the provided shortenUrl +module.exports.onClick = (id, accessId, metaData, controller) => controller.redirect(metaData.shortenUrl); + +module.exports.info = { + name: "Link kürzen", + icon: "link", + validationSchema: Joi.object({ + shortenUrl: Joi.string().max(2500).uri().required() + }), + meta: [{ + name: "Link-Einstellungen", + type: "default", + fields: { + shortenUrl: { + type: "text", + name: "Zu kürzende URL", + description: "Die zu kürzende (lange) URL" + } + } + }] +}