How can I serve static files in Node.js with flatiron/director?

72 views Asked by At

flatiron / director is an URL router.

Let's say I have a Node.js application with a public folder including static files like public CSS and JS files. How can I serve everything under this directory using director?

1

There are 1 answers

1
Aaron Franco On BEST ANSWER

You can use the static plugin for Flatiron to serve static files

app.use(flatiron.plugins.static, { root: __dirname });