Browse Source

server: configurable js endpoint

Joystream Stats 3 năm trước cách đây
mục cha
commit
8fef2ded34
2 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 2 1
      server/config.json
  2. 1 5
      server/joystream/ws.ts

+ 2 - 1
server/config.json

@@ -1,3 +1,4 @@
 {
-    "domain": "https://testnet.joystream.org"
+    "domain": "https://testnet.joystream.org",
+    "wsLocation": "wss://joystreamstats.live:9945"
 }

+ 1 - 5
server/joystream/ws.ts

@@ -1,11 +1,7 @@
-// TODO allow alternative backends
-
+ import {wsLocation} from "../config.json"
 import { ApiPromise, WsProvider } from '@polkadot/api'
 import { types } from '@joystream/types'
 
-const wsLocation =
-    'ws://localhost:9944'
-    // 'wss://rome-rpc-endpoint.joystream.org:9944'
 
 const connectUpstream = async (): Promise<ApiPromise> => {
     try {