I published my site on Netlify except that to access the API data I receive:
Failed to load resource: the server responded with a status of 404 ()
and to display certain images: Failed to load resource: the server responded with a status of 404 ().
and index-DNQVcT_m.js:48 Error fetching clean data: AxiosError
.
async fetchActivities() {
try {
const axiosResponse = await axios.get('/api/v1/Activities/all');
const data = axiosResponse.data;
const userId = this.getUser.userId;
const userResponse = await fetch(`/api/v1/Users/GetUser/${userId}`);
if (!userResponse.ok) {
throw new Error(`Failed to fetch user data, status: ${userResponse.status}`);
}
const userData = await userResponse.json();
const blockedUserIds = userData?.Blocked_Users?.map(user => user.id) || [];
});
});
viteconfig :
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'https://orbis-api-web.azurewebsites.net',
changeOrigin: true,
},
I tried replacing the urls with http://api.netlify.com/api/v1/url
and also https://api.netlify.com/api/v1/url
and also for loaded image I receive Failed to load resource: the server responded with a status of 404 ()