UNPKG

rjweb-server

Version:

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

19 lines (18 loc) 526 B
import ValueCollection from "../ValueCollection"; export default class ContentTypes { protected data: ValueCollection<string, string, string>; /** * Add A File -> Content Type Mapping * @example * ``` * const server = new Server(...) * * server.contentTypes((cT) => cT * .add('.png', 'image/png') * ) * ``` * @since 5.3.0 */ map( /** The File ending to apply this to */ ending: string, /** The Content Type to add to it */ contentType: string): this; }