2.0.10 • Published 26 days ago

vertx-http-gateway-js-connector v2.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
26 days ago

vertx-http-gateway-js-connector

NPM

What is it

Javascript implementation for vertx-http-gateway-connector

How to use

import * as http from "http";
import {AddressInfo} from "node:net";
import {VertxHttpGatewayConnector} from "../src";

const server = http.createServer((req, res) => {
    if (req.url?.includes("/js-service/a")) {
        res.writeHead(200, { 'Content-Type': 'text/plain' });
        res.end('js service okay');
    } else {
        res.writeHead(404, { 'Content-Type': 'text/plain' });
        res.end('not found');
    }
});

server.listen(0, "localhost", () => {
    const port = (server.address() as AddressInfo).port;
    console.log(`Http Server started at port ${port}`);
    const connector = new VertxHttpGatewayConnector({
        registerPort: 9090,
        registerHost: "localhost",
        registerUseSsl: false,
        serviceName: "js-service",
        servicePort: port,
        serviceUseSsl: false,
        instanceNum: 2,
        serviceHost: "localhost",
        registerPath: "/register"
    });

    connector.start();

    // setTimeout(() => connector.stop(), 10000);
});
2.0.10

26 days ago

2.0.9

2 months ago

2.0.8

2 months ago

2.0.7

2 months ago

2.0.3

2 months ago

2.0.2

2 months ago

2.0.5

2 months ago

2.0.4

2 months ago

2.0.6

2 months ago

2.0.0

2 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago