2.2.7 • Published 4 years ago

heq-server v2.2.7

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

heq-server

heq-server is a factory to create http server that follow heq protocol. The underlaying persistence layer and realtime notification can be implemented in adapters.

Adapters

Official:

Usage

It's recommended to use heq to start heq-server instances. However, if you want to programmatically start heq-server, you can use this package directly.

The following example will show you how to initiate an heq-server using redis as the persistence and realtime notification layer.

const factory = require('heq-server');
const config = {
  http: {
    // required
    port: 3000,

    // optional
    commitPath: '/commit',
    subscribePath: '/subscribe',
    queryPath: '/query',
  },

  queue: {
    // specify the adapter
    driver: '@heq/server-redis',

    // adapter options - please consult the documentation of in-use adapter
    url: 'redis://localhost:6379/2',
    ns: 'sample',
  },
};

const heq = await factory(config);

// start and receive an http server on port 3000
// this server will respond to GET /query, GET /subscribe and POST /commit
const httpServer = await heq.start();
2.2.7

4 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.0

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago