Add CORS plug to an additional cowboy server in a phoenix project

I have an extra cowboy server running in 8383 port in my Phoenix project. From my 4000 port I am trying to call an api to the 8383. But it throws error saying [Error] Preflight response is not successful. To fix this, how can I use a CORS Plug in the additional cowboy server. My application.ex code is given below:

defmodule MyApp.Application do
  # See
  # for more information on OTP Applications
  @moduledoc false

  use Application

  def start(_type, _args) do
    children = [
      # Start the Ecto repository
      # Start the Telemetry supervisor
      # Start the PubSub system
      {Phoenix.PubSub, name: MyApp.PubSub},
      # Start the Endpoint (http/https)
        scheme: :http,
        plug: MyAppWeb.TestSocket,
        options: [
          dispatch: dispatch(),
          port: 8383
 # Start a worker by calling: MyApp.Worker.start_link(arg)
      # {MyApp.Worker, arg}

    # See
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)

  # Tell Phoenix to update the endpoint configuration
  # whenever the application is updated.
  def config_change(changed, _new, removed) do
    MyAppWeb.Endpoint.config_change(changed, removed)

  defp dispatch do
         {"/account/:serial", MyAppWeb.TestSocket, []},
         {"/api/account/:serial/command", MyAppWeb.TestRouter, []}

Can this library cover your needs?