From 558e84ff7f58de731ee0ab0b5c313008cf6e1ef6 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Fri, 9 Sep 2022 01:07:09 +0200 Subject: [PATCH] Created the validation object for the link shortener --- api/validations/linkValidation.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 api/validations/linkValidation.ts diff --git a/api/validations/linkValidation.ts b/api/validations/linkValidation.ts new file mode 100644 index 0000000..70dd204 --- /dev/null +++ b/api/validations/linkValidation.ts @@ -0,0 +1,12 @@ +import Joi from 'joi'; + +export const shortUrl = Joi.object({ + originalUrl: Joi.string() + .uri() + .min(5) + .max(1000) + .required(), + shortenedId: Joi.string() + .min(5) + .max(15) +}); \ No newline at end of file