Last Updated: February 25, 2016
·
817
· usharf

Serving static HTML and assets with Express

When starting a project or prototyping w/o server side logic, initially, I use this line (in CoffeScript) to serve plain HTML with some JavaScript, CSS assets, e.g. for a Backbone.JS application:

app.use '/', express.static "#{__dirname}/public"