Convert from grpc to grpc-js, since the former is deprecated and no longer compiles...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 26 Jun 2021 21:19:25 +0000 (23:19 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 26 Jun 2021 21:19:25 +0000 (23:19 +0200)
server/hash-lookup.js
www/index.html

index 7d7daeb9099c6c36f2781cb4889f4fd573f86618..21e722a8644d2065448d1f575b77260ad52f8167 100644 (file)
@@ -1,8 +1,17 @@
-var grpc = require('grpc');
+var grpc = require('@grpc/grpc-js');
 var Chess = require('../www/js/chess.js').Chess;
 
 var PROTO_PATH = __dirname + '/hashprobe.proto';
-var hashprobe_proto = grpc.load(PROTO_PATH).hashprobe;
+var protoLoader = require('@grpc/proto-loader');
+var packageDefinition = protoLoader.loadSync(
+    PROTO_PATH,
+    {keepCase: true,
+     longs: String,
+     enums: String,
+     defaults: true,
+     oneofs: true
+    });
+var hashprobe_proto = grpc.loadPackageDefinition(packageDefinition).hashprobe;
 
 var board = new Chess();
 
index 5158266e2af5c55271336dca49110feeac8356aa..8dbead3dbdf12a54609b7d466813135d27b0753f 100644 (file)
   <span id="lomonosov">7-man Lomonosov tablebase lookup by <a href="http://tb7.chessok.com/">ChessOK</a>.</span></p>
 
 <!-- For faster development -->
+<!--
 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
 <script type="text/javascript" src="js/chessboard-0.3.0.min.js"></script>
 <script type="text/javascript" src="js/chess.js"></script>
 <script type="text/javascript" src="js/json_delta.js"></script>
 <script type="text/javascript" src="js/jquery.sparkline.js"></script>
 <script type="text/javascript" src="js/remoteglot.js"></script>
-<!--
 -->
 
 <!-- Minified version of the previous six, compiled together -->
-<!--
 <script type="text/javascript" src="js/remoteglot.min.js"></script>
+<!--
 -->
 </body>
 </html>