Closed N0tExisting closed 3 months ago
When giving a custom path into the connect() method it is ignored.
connect()
This is anoying because of my dev setup:
import { defineConfig } from 'vite'; export default defineConfig({ server: { proxy: { '/db': 'http://localhost:8000/', }, }, });
import Surreal from 'surrealdb.js'; const db = new Surreal(); const url = new URL(location.href); url.pathname = '/db/rpc'; url.protocol = url.protocol === 'http' ? 'ws' : 'wss'; await db.connect(url.href, p);
results in:
SurrealSocket.ts:56 WebSocket connection to 'wss://localhost:3000/rpc' failed: open @ SurrealSocket.ts:56
Connecting to the database should respect the path in the URL.
unrelated
0.11.0
No response
Hey @N0tExisting, the v1.0.0-beta.x release(s) solve this issue 😃
Describe the bug
When giving a custom path into the
connect()
method it is ignored.This is anoying because of my dev setup:
Steps to reproduce
results in:
Expected behaviour
Connecting to the database should respect the path in the URL.
SurrealDB version
unrelated
SurrealDB.js version
0.11.0
Contact Details
No response
Is there an existing issue for this?
Code of Conduct