Hono environment type that extends Env
Configuration options for S3 client
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 });
});
S3 middleware for Hono
Creates AWS SDK v3 S3 and S3Client instances and sets them in the Hono context to generate middleware.