Updated with server url
This commit is contained in:
parent
a0a4aade97
commit
b9eb903f93
@ -9,6 +9,9 @@ RUN yarn install --frozen-lockfile
|
|||||||
# Rebuild the source code only when needed
|
# Rebuild the source code only when needed
|
||||||
FROM node:14-alpine AS builder
|
FROM node:14-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
ARG NEXT_PUBLIC_SERVER_URL="http://localhost:5000"
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
@ -32,8 +32,11 @@ export const SocketProvider: FC = (props) => {
|
|||||||
const [inboxTodos, setInboxTodos] = useState<Todo[]>([]);
|
const [inboxTodos, setInboxTodos] = useState<Todo[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const serverUrl =
|
||||||
|
process.env.NEXT_PUBLIC_SERVER_URL || "http://localhost:5000";
|
||||||
|
|
||||||
const connection = new HubConnectionBuilder()
|
const connection = new HubConnectionBuilder()
|
||||||
.withUrl("http://localhost:5000/hubs/todo")
|
.withUrl(`${serverUrl}/hubs/todo`)
|
||||||
.withAutomaticReconnect()
|
.withAutomaticReconnect()
|
||||||
.configureLogging(LogLevel.Information)
|
.configureLogging(LogLevel.Information)
|
||||||
.build();
|
.build();
|
||||||
|
@ -31,5 +31,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
build:
|
build:
|
||||||
context: client
|
context: client
|
||||||
|
args:
|
||||||
|
NEXT_PUBLIC_SERVER_URL: "https://api-todo.front.kjuulh.io"
|
||||||
ports:
|
ports:
|
||||||
- 12008:3000
|
- 12008:3000
|
||||||
|
Loading…
Reference in New Issue
Block a user