Type Alias SendFileOptions

SendFileOptions: {
    filepath: string;
    from?: string;
    next?: NextFunction;
    res: Response;
}

The options for the function that actually serves a file.

Type declaration

  • filepath: string

    The path of the file to serve. Depending on the from option, it will be either relative to the project root, or the application executable.

  • Optionalfrom?: string

    The name of a location on the pathUtils service from where the filepath is relative to. It can be app for the directory containing the application executable, or project for the project root. It could also be any other location that the implementation may have registered.

    'app'
    
  • Optionalnext?: NextFunction

    The function to move to the next middleware. It can be used to report an error in case the file can't be served.

    {() => {}}
    
  • res: Response

    The response object sent by the application. Necessary to write the file.