I'm uploading an image using angular2 and nodejs, when node uploads file in assets folder, I try to show it using angular and get an error:
GET http://localhost:4200/assets/img/3.jpg 404 (Not Found)
As you reply to my comment - you are using
The thing is, when you are running
ng serve that triggered in memory
webpack dev server - not a thing you want to run on your server, that is for dev only. This way, until you restarted
ng serve, you wont get any changes happend in your
assets folder as it is default folder for your
static assets configured in
You use the assets array in .angular-cli.json to list files or folders you want to copy as-is when building your project.
assets folder is not the best place to store any dynamic content.