How to use the Server function from bindings

Find comprehensive JavaScript bindings.Server code examples handpicked from public code repositorys.

580
581
582
583
584
585
586
587
588
589
 *     implementation
 */
function Server(options) {
  this.handlers = {};
  var handlers = this.handlers;
  var server = new grpc.Server(options);
  this._server = server;
  this.started = false;
  /**
   * Start the server and begin handling requests
fork icon1
star icon0
watch icon0

60
61
62
63
64
65
66
67
68
69
70


describe('end-to-end', function() {
  var server;
  var channel;
  before(function() {
    server = new grpc.Server();
    var port_num = server.addHttp2Port('0.0.0.0:0',
                                       grpc.ServerCredentials.createInsecure());
    server.start();
    channel = new grpc.Channel('localhost:' + port_num, insecureCreds);
fork icon1
star icon0
watch icon0

+ 2 other calls in file

37
38
39
40
41
42
43
44
45
46
47


describe('server', function() {
  describe('constructor', function() {
    it('should work with no arguments', function() {
      assert.doesNotThrow(function() {
        new grpc.Server();
      });
    });
    it('should work with an empty list argument', function() {
      assert.doesNotThrow(function() {
fork icon0
star icon1
watch icon0

+ 9 other calls in file

50
51
52
53
54
55
56
57
58
59
  });
});
it('should work without the new keyword', function() {
  var server;
  assert.doesNotThrow(function() {
    server = grpc.Server();
  });
  assert(server instanceof grpc.Server);
});
it('should only accept objects with string or int values', function() {
fork icon0
star icon0
watch icon0

+ 21 other calls in file

Other functions in bindings

Sorted by popularity

function icon

bindings.createKey is the most popular function in bindings (8616 examples)