summaryrefslogtreecommitdiff
path: root/utils.js
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2023-10-20 23:37:28 -0400
committerCarson Fleming <cflems@cflems.net>2023-10-20 23:37:28 -0400
commit5636edd5b6af3486284b430f660b1b9e309a3671 (patch)
treef065d63d75ba3aa08eefa51c2cab407dcac859c6 /utils.js
parent5b4f8c220bbcbe1ee4b684f91db7cc419e423a41 (diff)
downloadfle.ms-5636edd5b6af3486284b430f660b1b9e309a3671.tar.gz
Bring it all together and nitpick the appearance
Diffstat (limited to 'utils.js')
-rw-r--r--utils.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils.js b/utils.js
index eefc84d..695063f 100644
--- a/utils.js
+++ b/utils.js
@@ -1,7 +1,9 @@
const path = require('path');
const config = require('./config.js');
+const slugUtils = require('./static/js/slug.js');
const helperFunctions = {
+ generateSlug : slugUtils.generateSlug,
sendFile : function (res, fileName) {
res.sendFile(fileName, {
root: path.join(__dirname)
@@ -23,9 +25,10 @@ const helperFunctions = {
});
},
sendBadRequestError : function (res, errorMessage) {
- res.status(400).json({status: "ERROR", statusCode: 400, errorType: "BAD REQUEST", errorMessage});
+ res.status(400).json({status: "ERROR", statusCode: 400, errorType: "BAD REQUEST", errorMessage, uiString: "Already Exists"});
},
- sendInternalServerError : function (res) {
+ sendInternalServerError : function (res, error) {
+ console.error('[express] Error:', error);
res.status(404).json({status: "ERROR", statusCode: 500, errorType: "INTERNAL", errorMessage: "Internal Server Error"});
},
sendSuccessfulSlugCreation : function (res, slug) {