How to use @depscloud/api - 1 common examples

To help you get started, we’ve selected a few @depscloud/api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github depscloud / depscloud / extractor / src / main.ts View on Github external
return {
                matcher: new Matcher(extractor.matchConfig()),
                extractor,
            }
        });

        const impl: AsyncDependencyExtractor = new DependencyExtractorImpl(matchersAndExtractors);

        const healthcheck = new health.Implementation({
            "": healthv1.HealthCheckResponse.ServingStatus.SERVING,
        });
        // toggle the service health as such
        // healthcheck.setStatus("", healthv1.HealthCheckResponse.ServingStatus.NOT_SERVING);

        const server = new Server();
        server.addService(DependencyExtractor.service, unasyncify(impl));
        server.addService(health.service, healthcheck);

        let credentials = ServerCredentials.createInsecure();
        if (options.tlsKey && options.tlsCert && options.tlsCa) {
            const [ key, cert, ca ] = await Promise.all([
                asyncFs.readFile(options.tlsKey),
                asyncFs.readFile(options.tlsCert),
                asyncFs.readFile(options.tlsCa),
            ]);

            credentials = ServerCredentials.createSsl(ca, [ {
                private_key: key,
                cert_chain: cert,
            } ], true);
        }

@depscloud/api

NodeJS client to the deps.cloud API

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis