Closed karthik2804 closed 1 year ago
This PR allows the return type to be more flexible on the body parameter
export async function handleRequest(request) { return { status: 200, headers: { "foo": "bar" }, body: "Hello from JS-SDK" } }
This PR also adds a new handler function signature handler(req, res) which allows creating responses using chaining
handler(req, res)
import { EventHandler, HttpRequest, HttpResponse } from "spin-sdk" export const eventHandler: EventHandler = async function (request: HttpRequest, response: ResponseObject): Promise<void> { response.status(200).header("content-type", "text/html").body("Chaining works") }
Signed-off-by: karthik Ganeshram karthik.ganeshram@fermyon.com
Will move the implementation of the alternate function signature to a separate PR.
This PR allows the return type to be more flexible on the body parameter
This PR also adds a new handler function signature
handler(req, res)
which allows creating responses using chainingSigned-off-by: karthik Ganeshram karthik.ganeshram@fermyon.com