feat(DevOps): ⚡ add nginx reverse proxy
This commit is contained in:
parent
180e204c2d
commit
5b98be1644
6 changed files with 92 additions and 8 deletions
|
@ -141,7 +141,11 @@ const ChatWindow = () => {
|
|||
const initialMessage = searchParams.get('q');
|
||||
|
||||
const [isReady, setIsReady] = useState(false);
|
||||
const ws = useSocket(process.env.NEXT_PUBLIC_WS_URL!, setIsReady);
|
||||
const publicHostname = typeof window !== 'undefined' && window.location.hostname;
|
||||
const publicPort = typeof window !== 'undefined' && window.location.port;
|
||||
const publicUrl = `${publicHostname}${publicPort ? `:${publicPort}` : ''}`;
|
||||
const webSocketUrl = process.env.NEXT_PUBLIC_WS_URL || `ws://${publicUrl}/ws`;
|
||||
const ws = useSocket(webSocketUrl, setIsReady);
|
||||
|
||||
const [chatHistory, setChatHistory] = useState<[string, string][]>([]);
|
||||
const [messages, setMessages] = useState<Message[]>([]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue