blocked by CORS policy Method PATCH is not allowed

im tryng build crud app using MERN stack,
method add and get not got blocked by cors,
but patch method got blocked by cors
alredy install cors module on my server
and still didnt work

routes

import express from 'express';
import { createPost, getPost, updatePost } from '../controllers/posts.js';

const router = express.Router();

router.get('/', getPost);
router.post('/', createPost);
router.patch('/:id', updatePost);

export default router;


server/controllers

export const updatePost = async (req, res) => {
  const { id: _id } = req.params;
  const post = req.body;
  if (!mongoose.Types.ObjectId.isValid(id))
    return res.status(404).send(`no post with id ${id}`);
  const updatedPost = postMessage.findByIdAndUpdate(_id, post, { new: true });
  res.json(updatedPost);
};


client>src>api
import axios from 'axios';

const url = 'http://localhost:3001/posts';

export const fetchPosts = () => axios.get(url);
export const createPost = (newPost) => axios.post(url, newPost);
export const updatePost = (id, updatePost) =>
  axios.patch(`${url}/${id}`, updatePost);