Compare commits
2 Commits
a298159ce2
...
a5ec63b064
| Author | SHA1 | Date | |
|---|---|---|---|
| a5ec63b064 | |||
| bd64eea849 |
@@ -45,7 +45,14 @@ jobs:
|
|||||||
# ---------- Frontend ----------
|
# ---------- Frontend ----------
|
||||||
- name: Build Frontend (${{ env.TAG }})
|
- name: Build Frontend (${{ env.TAG }})
|
||||||
run: |
|
run: |
|
||||||
|
if [ "$TAG" = "dev" ]; then
|
||||||
|
API_URL="http://t610:5005/api"
|
||||||
|
else
|
||||||
|
API_URL="http://t610:5004/api"
|
||||||
|
fi
|
||||||
|
|
||||||
docker build \
|
docker build \
|
||||||
|
--build-arg VITE_API_URL=$API_URL \
|
||||||
-t $REGISTRY/hospitality-frontend:${TAG} \
|
-t $REGISTRY/hospitality-frontend:${TAG} \
|
||||||
-f src/hospitality-web/Dockerfile \
|
-f src/hospitality-web/Dockerfile \
|
||||||
src/hospitality-web
|
src/hospitality-web
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ RUN npm ci
|
|||||||
# Kopier resten av koden
|
# Kopier resten av koden
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
ARG VITE_API_URL
|
||||||
|
ENV VITE_API_URL=$VITE_API_URL
|
||||||
|
|
||||||
# Bygg for produksjon
|
# Bygg for produksjon
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import type { LoginRequest, LoginResponse, UserInfo } from '../types/auth';
|
import type { LoginRequest, LoginResponse, UserInfo } from '../types/auth';
|
||||||
|
|
||||||
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:5163/api';
|
const API_BASE_URL = import.meta.env.VITE_API_URL;
|
||||||
|
|
||||||
export const api = axios.create({
|
export const api = axios.create({
|
||||||
baseURL: API_BASE_URL,
|
baseURL: API_BASE_URL,
|
||||||
|
|||||||
Reference in New Issue
Block a user