Hono DynamoDB Middleware - v1.1.1
    Preparing search index...

    Function s3Middleware

    • S3 middleware for Hono

      Creates AWS SDK v3 S3 and S3Client instances and sets them in the Hono context to generate middleware.

      Type Parameters

      • E extends Env

        Hono environment type that extends Env

      Parameters

      • config: S3ClientConfig = {}

        Configuration options for S3 client

      Returns MiddlewareHandler<E>

      Hono middleware that sets S3 instances

      import { Hono } from 'hono';
      import { s3Middleware, Env } from '@squilla/hono-aws-middlewares';

      const app = new Hono<Env>();

      // Set up middleware
      app.use('*', s3Middleware({
      region: 'ap-northeast-1'
      }));

      // Use S3
      app.get('/config', async (c) => {
      const s3 = c.get('S3');
      const result = await s3.getObject({
      Bucket: 'my-bucket',
      Key: 'my-key'
      });
      return c.json({ config: result.Body });
      });

      1.1.0