mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 15:26:33 +00:00
chore: replace hardcoded WebSocket URL with environment variable
- Replaced the hardcoded LSP WebSocket URL with a configurable environment variable (NEXT_PUBLIC_LSP_C_URL). - Default to "ws://localhost:4594/clangd" if the environment variable is not set.
This commit is contained in:
parent
6c5beeb27c
commit
3f2bc8c332
@ -27,7 +27,8 @@ export default function CodeEditor() {
|
|||||||
const { resolvedTheme } = useTheme();
|
const { resolvedTheme } = useTheme();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const url = normalizeUrl("ws://localhost:4594/clangd");
|
const lspUrl = process.env.NEXT_PUBLIC_LSP_C_URL || "ws://localhost:4594/clangd";
|
||||||
|
const url = normalizeUrl(lspUrl);
|
||||||
const webSocket = new WebSocket(url);
|
const webSocket = new WebSocket(url);
|
||||||
|
|
||||||
webSocket.onopen = async () => {
|
webSocket.onopen = async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user