Iskra API Reference
    Preparing search index...

    Function bindBody

    • The request's body parsed by schema, typed; throws a ValidationError (400, with the failed fields in details) when it does not match. JSON by default; see BindOptions for forms and case-insensitive keys.

      app.post('/users', async (c) => {
      const user = await bindBody(c, z.object({ nombre: z.string() }), { caseInsensitiveKeys: true });
      return ok(c, await users.create(user), { status: 201 });
      });

      Type Parameters

      • T

      Parameters

      Returns Promise<T>