0
votes

need to access node_module directory files from the index.html file which was inside a sub directories and the node_module directory is in the same location of parent directory. Here i'm using angularjs and the static folder to server files is the public directory.

app.use(express.static(__dirname + '/public'));

Directory structure is provided in the screenshot.enter image description here

1

1 Answers

1
votes

try this for node_modules folder also

app.use(express.static(__dirname + '/node_modules'));

and then in index.html you can directly access sub directories of node_modules folder for eg.

<script src="async/component.json"></script>