UNPKG

rexuws

Version:

An express-like framework built on top of uWebsocket.js aims at simple codebase and high performance

25 lines (24 loc) 744 B
import * as uWS from 'uWebSockets.js'; import { HttpMethod, IRequest, IResponse } from '../../../utils/types'; import { NextFunction } from '../../core/types'; export interface IMultipartParserOptions { /** * Only run on spefic routes * * If `true` parse on all POST/PUT/PATCH request */ allow?: { method?: HttpMethod.POST | HttpMethod.PUT | HttpMethod.PATCH; path: string; }[] | true; /** * Max size to parse */ maxSize?: number; } export declare type TMultipartParsedResult<T = { [key: string]: unknown; }> = { [key: string]: Partial<uWS.MultipartField>; } & Partial<T>; export declare const multipartParser: (req: IRequest, _: IResponse, next: NextFunction) => void;