Skip to content

Form Actions #11

@Mohamed-Kaizen

Description

@Mohamed-Kaizen

I was trying to make form action work, i was trying to to make it work thought the hook.server

import type { Handle } from "@sveltejs/kit"

export const handle = (async ({ event, resolve }) => {
 	if (event.request.method === "POST") {
 		const _url = event.request.url.split("?/")
 		const url = _url[0]
 		const action = _url[1]

 		event.request = new Request(url, event.request)
 		// Send it to the python server....
 		
 		// find  a way to resolve and return the data, from the python server...
 	}
 	const resp = await resolve(event)
 	return resp
}) satisfies Handle

currently with this code we can intercept the post request from the form and send it to the python server , the problem is the how to return the correct response.

I was thinking we can talk about ...how to handle the form actions with python

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions