Appearance
SRI
This middleware is installed when using the Codedraw generic backend implementation template. It ensures to extract the necessary request and store them to the context
.
Interface
typescript
import { Context } from 'hono';
import { HonoApp } from '../sys/types';
export declare const ExtractRequestArguments: (context: Context<HonoApp<{}, {}>, any, any>, next: Function) => Promise<any>;
Extracted info
This middlewares extracts the sri
from the path parameter on the GET
, POST
, PUT
, DELETE
and sets it to the request context. To access it:
typescript
import { SRI } from '@coderpunktech/codedraw-core'
//...
const sri: SRI.SRI = context.get('sri')
//...
It also extracts the body
on each POST
and PUT
requests and sets it to the request context. To access it:
typescript
import { SRI } from '@coderpunktech/codedraw-core'
//...
const body: { [key: string]: any } = context.get('payload')
//...