Skip to content

Commit

Permalink
optimization for websocket URL
Browse files Browse the repository at this point in the history
  • Loading branch information
valorant-dhruv committed Mar 7, 2024
1 parent 070ad85 commit 141cff8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/connect/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ class ConnectRaw extends Connection {
}

export const connect = {
s3free: ({ blockstore }: Connectable,database:string) => {
s3free: ({ blockstore }: Connectable, databasename: string) => {
// const upload = 'https://udvtu5wy39.execute-api.us-east-2.amazonaws.com/uploads'
const upload = 'https://04cqe6md3e.execute-api.us-east-1.amazonaws.com/uploads'
// const download = 'https://crdt-s3uploadbucket-dcjyurxwxmba.s3.us-east-2.amazonaws.com'
const download = 'https://fireproof-aws-connector-v1-s3uploadbucket-osbywa8svf97.s3.amazonaws.com'
const websocket=`wss://mqnxbdkh4g.execute-api.us-east-1.amazonaws.com/Prod?database=${database}`
const websocket=`wss://mqnxbdkh4g.execute-api.us-east-1.amazonaws.com/Prod?database=${databasename}`
const connection = new ConnectS3(upload, download, websocket)
connection.connect(blockstore)
return connection
},
s3: ({ blockstore }: Connectable, { upload, download, websocket }: { upload: string; download: string; websocket: string }) => {
const connection = new ConnectS3(upload, download, websocket)
s3: ({ blockstore }: Connectable, { upload, download, websocket, databasename }: { upload: string; download: string; websocket: string; databasename: string }) => {
const updatedwebsocket= `${websocket}?database=${databasename}`
const connection = new ConnectS3(upload, download, updatedwebsocket)
connection.connect(blockstore)
return connection
},
Expand Down
3 changes: 2 additions & 1 deletion packages/fireproof/test/www/todo.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"https://04cqe6md3e.execute-api.us-east-1.amazonaws.com/uploads",
download:
"https://fireproof-aws-connector-v1-s3uploadbucket-osbywa8svf97.s3.amazonaws.com",
websocket: `wss://mqnxbdkh4g.execute-api.us-east-1.amazonaws.com/Prod?database=${dbName}`,
websocket: 'wss://mqnxbdkh4g.execute-api.us-east-1.amazonaws.com/Prod',
databasename: dbName
});
cx.ready.then(async () => {
const span = document.querySelector('#cxInfo')
Expand Down

0 comments on commit 141cff8

Please sign in to comment.