Add base auth & ucan request flow (web only)

This commit is contained in:
Paul Frazee 2022-06-14 14:29:47 -05:00
parent 09b78a4634
commit cef133031e
14 changed files with 1555 additions and 290 deletions

View file

@ -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()