@indiekit/endpoint-share
Version:
Share endpoint for Indiekit. Provides a simple interface for bookmarking websites and publishing them on your website.
14 lines (12 loc) • 352 B
JavaScript
import { check } from "express-validator";
export const validate = [
check("name")
.notEmpty()
.withMessage((value, { req, path }) => req.__(`share.error.${path}.empty`)),
check("bookmark-of")
.exists()
.isURL()
.withMessage((value, { req, path }) =>
req.__(`share.error.${path}.empty`, "https://example.org"),
),
];