/*
    ! /routers/.templateRouter.js
    ? Express route handler template.
*/

// % export default route handler function
export default async function handleRoute(router) {
    // $ Define endpoints using the passed router instance
    router.get('/', async (req, res) => {
        // $ Business logic for GET request
        res.json({ status: 'success', message: 'Route reached successfully!' });
    });

    router.post('/', async (req, res) => {
        // $ Business logic for POST request
        const data = req.body;
        res.json({ status: 'success', received: data });
    });
}