0

I added to my html page:

<script src="/node_modules/angular/angular.min.js"></script>

but i have error:

GET http://localhost:30003/node_modules/angular/angular.min.js 404 (Not Found)

i tried to add into my server file:

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

and it doesn't help. Please tell me how i can solve it ?

Uladz Kha
  • 2,154
  • 4
  • 40
  • 61

1 Answers1

1

Use like this:

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

And then in your HTML you can get it like this:

<script src="/scripts/angular.min.js"></script>
Diogo Capela
  • 5,669
  • 5
  • 24
  • 35