SiberianGuy
SiberianGuy

Reputation: 25302

Static folder in NodeJs

I suppose my question is basic but I'm new to Node.js infrastructure and feel very confused.

I have a simple web-site where all my js files are bundled by webpack into bundle.js that is available by /static/bundle.js path (according to webpack configuration).

But now I have another folder with static data in the root of my project and I want to make it publicly available by /static2/... address. How can I do this? Who is responsible for that (webpack, nodejs, etc.)?

Upvotes: 2

Views: 196

Answers (1)

uksz
uksz

Reputation: 18699

If you use express - you can take a look here:

http://expressjs.com/en/starter/static-files.html

For example:

app.use(express.static('public'));

Upvotes: 2

Related Questions