Does next js Server Action work if I use a custom server (Express) to serve the Next js app?

66 views Asked by At

I am trying to work with next js Server Action in my Next-Express-Ts project. I followed the official docs implement it. but it seems to be not working. And it returns 404 in the console.


    //actions.ts
    import { redirect } from "next/navigation";

    export async function myAction () {
      redirect('/test');
  
    }

    //component

    'use client'
    import { myAction } from './actions'

    export default function ClientComponent() {
      return (
        <form action={myAction}>
          <button type="submit">Go...</button>
        </form>
      )
    }
0

There are 0 answers