Hebilicious/form-actions-nuxt

Add support for actions on `/` (index) route

Opened this issue · 0 comments

Describe the feature

I think it would be great if the library supports form actions on the / route via server/actions/index.ts. Currently this is not possible, because the parser recognizes index.ts as a form action for the route /index:

export function getActionRoute(actionPath: string) {
const actionRegex = /.*actions[\/\\](.*?)\.ts/
const actionRoute = actionRegex.exec(actionPath)?.[1]
if (!actionRoute) throw new Error(`Could not parse action route from ${actionPath}`)
return actionRoute
}

Additional information

  • Would you be willing to help implement this feature?