Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating production branch #190

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion app/controllers/adminController.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,30 @@ const userHelpers = require('../../helpers/user-helpers');
require('dotenv').config(); // Module to Load environment variables from .env file


const PLATFORM_NAME = process.env.PLATFORM_NAME || "GetMyDeal"
const PLATFORM_NAME = process.env.PLATFORM_NAME || "GetMyDeal";

/* ============================================= HEALTH STATUS CONTROLLER ============================================= */

const healthStatusGET = (req, res) => {
const currentDate = new Date();
const options = {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric",
timeZone: "UTC",
};
const formattedDate = currentDate.toLocaleString("en-US", options);

res.status(200).json({
status: `${process.env.APPLICATION_NAME} and Systems are Up & Running.`,
dateTime: formattedDate,
});

};

/* ============================================= LOGIN & LOGOUT CONTROLLERS ============================================= */

Expand Down Expand Up @@ -576,6 +598,7 @@ const adminErrorHandlerPageGET = (req,res)=>{

module.exports = {

healthStatusGET,
logInGET,
logInPOST,
logOutPOST,
Expand Down
4 changes: 4 additions & 0 deletions routes/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const multerUploadBannerImage = multer.uploadBannerImage.single('banner-image');
/*=================================================ADMIN ROUTES=================================================*/


/* ========================HEALTH CHECK ROUTE======================== */

router.get('/health', adminController.healthStatusGET);

/* ========================LOGIN & LOGOUT ROUTES======================== */

router.get('/login', adminController.logInGET);
Expand Down
Loading