Translate

6 Temmuz 2016 Çarşamba

Serving static files in Express

If you had searched , you can find many solutions to serve static file in Express.js.

you might have seen this code

app.use(express.static(path.join(__dirname, 'public')));


Also you want to use jquery , bootstrap  ,angular.js files as local files.
You should named "bower_components" directory as public static file source by coding abowe.

app.use(express.static(path.join(__dirname, 'bower_components')));

now these files are enabled .You can reach all sources under bower_components public files.


Hiç yorum yok:

Yorum Gönder

Bu Blogda Ara