• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

42
Views
In Vue js Image can't find from Node Js server

I have run my Nodejs server in 3000 port and Vuejs 8080 port. Now I can get data from "posts" collection via API but when a want to access image it can't find the image.

My Error is :GET http://localhost:3000/images/1656300140014picture.PNG 404 (Not Found)

               <tbody>
                  <tr v-for="(item, index) in getAllPost" :key="item._id">
                    <td>{{ index + 1 }}</td>
                    <td>
                      
                      <img
                        :src="
                          'http://localhost:3000/images/' + item.postImage
                        "
                        style="width: 50px"
                      />

                    </td>
                    <td v-if="item.author">{{ item.author.userName }}</td>
                    <td v-if="item.author == null">N/A</td>
                    <td>{{ item.title }}</td>

                    <td class="text-right">
                      <router-link
                        :to="{ name: 'mainLayout' }"
                        class="btn btn-primary mr-2"
                      >
                        <i class="fas fa-eye"></i>
                      </router-link>
                      <button class="btn btn-primary mr-2">
                        <i class="fas fa-edit"></i>
                      </button>
                      <button class="btn btn-danger mr-2">
                        <i class="fas fa-trash"></i>
                      </button>
                    </td>
                  </tr>
                </tbody>

enter image description here

about 2 months ago ·

Juan Pablo Isaza

Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.