Skip to content

0.1.23

Compare
Choose a tag to compare
@benjamint08 benjamint08 released this 22 May 18:52
· 28 commits to master since this release

0.1.23 is here! What's new?

  • We added a json function exported from probun. Usage like this:
import { SendJSON, json, Failure } from "probun";

export async function POST(req: Request): Promise<Response> {
    try {
        const body = await json(req);
        return SendJSON({
            body
        }, 200);
    } catch (error) {
        return Failure("Invalid JSON.")
    }
}

That's all for now. Enjoy!