diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-06-14 14:29:47 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-06-14 14:29:47 -0500 |
commit | cef133031e501f8f73c66a379de38b1041287743 (patch) | |
tree | b628150cbee4facbcbfc06599baaf4c108949995 /scripts | |
parent | 09b78a46343088a2790dab067bd4fd8384957311 (diff) | |
download | voidsky-cef133031e501f8f73c66a379de38b1041287743.tar.zst |
Add base auth & ucan request flow (web only)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/testing-server.mjs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/testing-server.mjs b/scripts/testing-server.mjs index 3517acdf7..adc214cf9 100644 --- a/scripts/testing-server.mjs +++ b/scripts/testing-server.mjs @@ -1,16 +1,25 @@ -import {IpldStore} from '@adx/common' -import server from '@adx/server/dist/server.js' -import Database from '@adx/server/dist/db/index.js' +import {IpldStore} from '@adxp/common' +import PDSServer from '@adxp/server/dist/server.js' +import PDSDatabase from '@adxp/server/dist/db/index.js' +import WSRelayServer from '@adxp/ws-relay/dist/index.js' -const PORT = 1986 +const PDS_PORT = 2583 +const WSR_PORT = 3005 async function start() { console.log('Initializing...') - const db = Database.memory() + const db = PDSDatabase.memory() const serverBlockstore = IpldStore.createInMemory() await db.dropTables() await db.createTables() - server(serverBlockstore, db, PORT) + PDSServer(serverBlockstore, db, PDS_PORT) + + if (process.argv.includes('--relay')) { + WSRelayServer(WSR_PORT) + console.log(`🔁 Relay server running on port ${WSR_PORT}`) + } else { + console.log('Include --relay to start the WS Relay') + } } start() |