Task Name: "Create Router for Task Controller" 
			Description: "Generate a Node.js router for task controller with added parameters and imports."
			Requirements:
			1. Database: 
			2. Output needed: Return only the router code.
	       
			3. Tasks to implement: Create a router for task controller., 
Ensure all necessary API endpoints are defined., 
Add router parameters where needed., 
Set isImport to true., 
Add readSupportFile with file set to taskController.js and folder to src/controllers., 
Import the controller from ../controller/taskController.
	
			4. Supporting data 
const mongoose = require('mongoose');
const Task = require('../models/Task.js');
// Importing necessary modules
const mongoose = require('mongoose');
const Task = require('../models/Task.js');

// Function to create a new task
exports.createTasks = async (req, res) => {
    try {
        // Destructuring the request body
        const { projectId, title, description, assignedTo, priority, status, deadline } = req.body;

        // Validate required fields: projectId, title, and assignedTo
        if (!projectId || !title || !assignedTo) {
            return res.status(400).json({ error: 'projectId, title, and assignedTo are required fields.' });
        }

        // Create a new Task instance
        const task = new Task({
            projectId,
            title,
            description,
            assignedTo,
            priority: priority || 'Medium', // Setting default value if not provided
            status: status || 'Pending',    // Setting default value if not provided
            deadline
        });

        // Save the task to the database
        await task.save();

        // Respond with success message
        res.status(201).json({ message: 'Task created successfully', task });
    } catch (error) {
        // Handling errors: database or others
        console.error('Error creating task:', error);
        res.status(500).json({ error: 'An error occurred while creating the task' });
    }
};

// Function to read and filter tasks
exports.readAllTasks = async (req, res) => {
    try {
        // Extract query parameters
        const { projectId, status, assignedTo } = req.query;

        // Initialize filter object
        let filter = {};

        // Add filters for projectId, status, and assignedTo if they exist
        if (projectId) filter.projectId = projectId;
        if (status) filter.status = { $in: ['Pending', 'In Progress', 'Completed'].includes(status) ? status : [] };
        if (assignedTo) filter.assignedTo = mongoose.Types.ObjectId.isValid(assignedTo) ? assignedTo : null;

        // Ensure valid ObjectId for assignedTo
        if (assignedTo && !mongoose.Types.ObjectId.isValid(assignedTo)) {
            return res.status(400).json({ error: 'Invalid assignedTo parameter' });
        }

        // Fetch tasks from database with applied filters
        const tasks = await Task.find(filter).exec();

        // Respond with filtered tasks
        res.status(200).json(tasks);

    } catch (error) {
        // Error handling
        console.error('Error fetching tasks:', error);
        res.status(500).json({ error: 'An error occurred while fetching tasks' });
    }
};

// const Task = require('./models/Task'); // Assuming Task model is in models/Task.js
const User = require('./models/User'); // Assuming User model is in models/User.js, to verify assigned user or Project Manager

exports.updateTask = async (req, res) => {
    try {
        // Destructuring taskId and updatedTaskDetails from request body
        const { taskId, updatedTaskDetails } = req.body;

        // Validating taskId and updatedTaskDetails presence
        if (!taskId || !updatedTaskDetails) {
            return res.status(400).json({ message: 'Task ID and updated task details are required.' });
        }

        // Retrieving the task to update
        const task = await Task.findById(taskId);
        if (!task) {
            return res.status(404).json({ message: 'Task not found.' });
        }

        // Check if the current user is an assigned user or a Project Manager
        const user = await User.findById(req.user.id); // Assuming req.user contains the currently authenticated user
        if (!user || (task.assignedTo.toString() !== user.id && !user.roles.includes('Project Manager'))) {
            return res.status(403).json({ message: 'Unauthorized to update this task.' });
        }

        // Updating the task with new details
        Object.assign(task, updatedTaskDetails);

        // Save the updated task to the database
        await task.save();

        // Sending a success response with the updated task details
        res.status(200).json({
            message: 'Task updated successfully.',
            updatedTask: task
        });
    } catch (error) {
        // Handling potential errors and sending an appropriate response
        res.status(500).json({
            message: 'An error occurred while updating the task.',
            error: error.message
        });
    }
};

// Function to delete a task by ID
exports.deleteTask = async (req, res) => {
    try {
        // Extracting taskId from request parameters
        const { taskId } = req.params;

        // Validating if taskId is provided
        if (!taskId) {
            return res.status(400).json({ message: 'Task ID is required.' });
        }

        // Validating if taskId is a valid mongoose ObjectId
        if (!mongoose.Types.ObjectId.isValid(taskId)) {
            return res.status(400).json({ message: 'Invalid Task ID format.' });
        }

        // Deleting the task from the database using mongoose
        const deletedTask = await Task.findByIdAndDelete(taskId);

        // If task not found, respond with an error
        if (!deletedTask) {
            return res.status(404).json({ message: 'Task not found.' });
        }

        // Responding with a success message
        return res.status(200).json({ message: 'Task deleted successfully.' });
    } catch (error) {
        // Handling potential errors
        console.error('Error deleting task:', error);
        return res.status(500).json({ message: 'Internal server error.' });
    }
};

			
		Please generate the code for above tasks, following the instructions and including comments for clarity and logic for Dependencies must needed.
	
		While creating router for specifict file your have to read supporing file data and create for that 
	
		 **Output Formats**: 

Return dependencies like this `const bcrypt = require('bcrypt');`  in this formate
```dependencies
const bcrypt = require('bcrypt');
```

Ensure this format is consistently followed in responses.