Without less file is there any chance to use font-awesome in node with express framework Please help Thank You
Asked
Active
Viewed 2,940 times
3
-
Definitely you can. – CuriousMind Aug 09 '17 at 03:45
-
Sorry i am asking how can i use without less file, Please let me know @CuriousMind – Lalit Mohan Aug 09 '17 at 03:49
-
app.use(express.static('public')); for serving static files link for reference ... https://expressjs.com/en/starter/static-files.html – Chandra Shekhar Aug 09 '17 at 05:38
-
Use a CDN I guess, then u don't have to download a new file in your server https://www.bootstrapcdn.com/fontawesome/ – Felix Fong Aug 09 '17 at 06:41
1 Answers
2
Set the public directory and include the font-awesome library.
/* Public static directory */
app.use(express.static(__dirname + '/public'));
So your app structure should be something like this,
public/
vendor/
font-awesome-4.7.0/
css/
js/ ..etc
In your html file include as usual
<link rel="stylesheet" href="../vendor/font-awesome-4.7.0/css/font-awesome.min.css">

Bharathvaj Ganesan
- 3,054
- 1
- 18
- 32
-
2Is this not considered bad practice since it exposes your file structure in the html file? – 55 Cancri Nov 26 '17 at 16:48
-
No. Everything on the client is visible to the user. They can access your assets, just codes etc. If you don't make these as public they won't be accessible by the browser. – Bharathvaj Ganesan Nov 26 '17 at 17:37