summaryrefslogtreecommitdiff
path: root/routes.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes.js')
-rw-r--r--routes.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/routes.js b/routes.js
index 207a022..ec333ec 100644
--- a/routes.js
+++ b/routes.js
@@ -7,13 +7,13 @@ const router = express.Router();
async function createRoute(res, url, slug) {
try {
if (!utils.isUrlFormatted(url))
- return utils.sendBadRequestError(res, 'URL "'+url+'" is malformatted. Must be a valid URL.');
+ return utils.sendBadRequestError(res, 'URL "'+url+'" is malformatted. Must be a valid URL.', 'Malformed URL');
if (!utils.isAlphaNumeric(slug))
- return utils.sendBadRequestError(res, 'Slug "'+slug+'" is malformatted. Must be alphanumeric.');
+ return utils.sendBadRequestError(res, 'Slug "'+slug+'" is malformatted. Must be alphanumeric.', 'Malformed Short URL');
slug = slug.toLowerCase();
if (await Url.exists({slug: slug}))
- return utils.sendBadRequestError(res, 'Slug "'+slug+'" already exists. Updates are not supported at this time.');
+ return utils.sendBadRequestError(res, 'Slug "'+slug+'" already exists. Updates are not supported at this time.', 'Already Exists');
await new Url({url, slug}).save();
utils.sendSuccessfulSlugCreation(res, slug);