SnipZard
Search snippets
Home
Portfolio
Contact
Serving Static Files
Express allows serving static files like HTML, CSS, and images using the `express.static` middleware.
Snippet:
app
.
use
(
express
.
static
(
"public"
)
)
;
Copy Code
Example:
app
.
use
(
"/static"
,
express
.
static
(
__dirname
+
"/public"
)
)
;
Copy Code