Am saving my images into a folder, while the image name is saved in the database. In my backend I already made the upload folder a named static folder
app.use(express.static(path.join(__dirname, 'public')));
So I am trying to get the image in my vuejs code.
<img class="profile-user-img img-fluid img-circle" :src="getProfilePhoto()" alt="User profile picture">
My Method.
getProfilePhoto() {
if(this.profiles.file){
this.profiles.file = this.profiles.file.replace(/^\/+|\/+$/g, '')
return (`http://localhost:8081/public/images/${this.profiles.file}`)
}
console.log(this.profiles.name)
},
But I am getting 404 Not found and undefined.
I try to log the image but the result is undefined