June 2014
Intermediate to advanced
696 pages
38h 52m
English
A great helper method in Express is the sendfile(filepath) method on the Response object. sendfile() uses a single function call to do everything that needs to be done to send files to the client. Specifically, the sendfile() method does the following:
Sets the Content-Type header to the type based on file extension.
Sets other appropriate headers, such as Content-Length.
Sets the status of the response.
Sends the contents of the ...
Read now
Unlock full access