UNPKG

rjweb-server

Version:

Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS

27 lines (26 loc) 745 B
export default class RouteContentTypes { private contentTypes; /** Generate Content Type Block */ constructor( /** Content Types to import */ contentTypes?: Record<string, string>); /** * Add A File -> Content Type Mapping * @example * ``` * const controller = new Server({ }) * * controller.contentTypes((cT) => cT * .add('.png', 'image/png') * ) * ``` * @since 5.3.0 */ add( /** The File ending to apply this to */ ending: string, /** The Content Type to add to it */ contentType: string): this; /** * Internal Method for Generating Content Types Object * @since 5.3.0 */ getData(): { contentTypes: Record<string, string>; }; }