Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/routes/NewRecipePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default function NewRecipePage({
const formData = new FormData()
formData.append('image', recipeData.imageFile)

const uploadResponse = await fetch('http://localhost:3001/upload', {
const uploadResponse = await fetch('/project2/upload', {
method: 'POST',
body: formData,
})
Expand Down
2 changes: 1 addition & 1 deletion client/src/routes/RecipeDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getImageUrl(imageUrl: string | null | undefined) {
}

// Bilder som er lastet opp til backend
return `http://localhost:3001/${imageUrl.replace(/^\/+/, '')}`
return `/project2/${imageUrl.replace(/^\/+/, '')}`
}

// Henter oppskriften basert på ID-en i URL-en
Expand Down
2 changes: 1 addition & 1 deletion client/src/routes/RecipeListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getImageUrl(imageUrl: string | null | undefined) {
}

// Bilder som er lastet opp til backend
return `http://localhost:3001/${imageUrl.replace(/^\/+/, '')}`
return `/project2/${imageUrl.replace(/^\/+/, '')}`
}

// Listen over alle oppskrifter eller søkeresultater
Expand Down
5 changes: 5 additions & 0 deletions deploy/apache-project2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ Alias /project2 /var/www/prosjekt2/client/dist
ProxyPass /project2/graphql http://localhost:3001/graphql
ProxyPassReverse /project2/graphql http://localhost:3001/graphql

ProxyPass /project2/uploads http://localhost:3001/uploads
ProxyPassReverse /project2/uploads http://localhost:3001/uploads

ProxyPass /project2/upload http://localhost:3001/upload
ProxyPassReverse /project2/upload http://localhost:3001/upload