June 2014
Intermediate to advanced
696 pages
38h 52m
English
The static middleware is very commonly used Express middleware. The static middleware allows you to server static files directly from disk to the client. You can use static middleware to support things like JavaScript files, CSS files, image files, and HTML documents that do not change. The static module is extremely easy to implement and uses the following syntax:
express.static(path, [options])
The path parameter specifies the root path from which the static files will be referenced in the requests. The options parameter allows you to set the following properties:
maxAge: The browser cache ...
Read now
Unlock full access