build frontend in node docker container
This commit is contained in:
1
frontend/.env
Normal file
1
frontend/.env
Normal file
@@ -0,0 +1 @@
|
|||||||
|
VITE_BASE_URL=
|
||||||
10
frontend/Dockerfile.frontend
Normal file
10
frontend/Dockerfile.frontend
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM node:alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json ./
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useSession } from "./Session";
|
import { useSession } from "./Session";
|
||||||
|
|
||||||
export const baseUrl = import.meta.env.VITE_BASE_URL as string;
|
export const baseUrl = "";
|
||||||
|
|
||||||
export async function apiAuth(
|
export async function apiAuth(
|
||||||
path: string,
|
path: string,
|
||||||
@@ -95,6 +95,7 @@ export type LoginRequest = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const login = async (req: LoginRequest): Promise<void> => {
|
export const login = async (req: LoginRequest): Promise<void> => {
|
||||||
|
console.log("baseUrl", baseUrl);
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${baseUrl}api/token`, {
|
const response = await fetch(`${baseUrl}api/token`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
Reference in New Issue
Block a user