Home Reference Source
import {WebpackSendFile} from 'projext-plugin-webpack/src/jimpex/sendFile.js'
public class | source

WebpackSendFile

This service overwrites the Jimpex default sendFile so it will use the frontendFs service to reads the file contents, thus using the virtual file system from the Webpack middleware.

Constructor Summary

Public Constructor
public

Class constructor.

Member Summary

Public Members
public

A local reference for the frontendFs service.

Method Summary

Public Methods
public

sendFile(res: Reponse, filepath: string, next: function)

Send a file on the Jimpex response.

Public Constructors

public constructor(frontendFs: WebpackFrontendFs) source

Class constructor.

Params:

NameTypeAttributeDescription
frontendFs WebpackFrontendFs

To be able to read the file from the middleware file system.

Public Members

public frontendFs: WebpackFrontendFs source

A local reference for the frontendFs service.

Public Methods

public sendFile(res: Reponse, filepath: string, next: function) source

Send a file on the Jimpex response.

Params:

NameTypeAttributeDescription
res Reponse

The response object generated by Express.

filepath string

The path to the file that needs to be sent.

next function
  • optional

If anything goes wrong, this function will be called with the exception.