3

Without less file is there any chance to use font-awesome in node with express framework Please help Thank You

Lalit Mohan
  • 464
  • 3
  • 16

1 Answers1

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
  • 2
    Is 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