Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@zowe/apiml-onboarding-enabler-nodejs
Advanced tools
Readme
This is the onboarding Node.js enabler for Zowe API Mediation Layer (part of Zowe) that allows to register a NodeJS based service to the API Mediation Layer Discovery Service. It uses eureka-js-client.
Install the onboarding Node.js enabler package as a dependency of your service:
npm i @zowe/apiml-onboarding-enabler-nodejs --dev-save
Inside your Node.js service index.js
, add the following code block to register your service with Eureka:
const apiLayerService = require("@zowe/apiml-onboarding-enabler-nodejs");
tlsOptions = apiLayerService.tlsOptions;
const httpsServer = https.createServer(tlsOptions, app);
httpsServer.listen(args.port, function () {
apiLayerService.connectToEureka();
});
To make sure that your application will automatically unregister from Eureka once shut down, you can use the unregisterFromEureka()
function, like shown in the example below.
Example:
process.on('SIGINT', signal => {
apiLayerService.unregisterFromEureka();
httpsServer.close(() => {
process.exit(0);
});
});
Create a yaml file named service-configuration.yml
, add the configuration properties and place the yaml file inside a /config
directory at the same level of your index.js
.
Below is an example of the configuration.
Example:
serviceId: hwexpress
title: Hello World express REST API
eureka:
ssl: true
host: localhost
ipAddress: 127.0.0.1
port: 10011
servicePath: '/eureka/apps/'
maxRetries: 30
requestRetryDelay: 1000
registryFetchInterval: 5
description: Hello World REST API Service implemented in Express and Node.js
baseUrl: https://localhost:10020/hwexpress
homePageRelativeUrl: https://localhost:10020/
statusPageRelativeUrl: https://localhost:10020/info
healthCheckRelativeUrl: https://localhost:10020/status
discoveryServiceUrls:
- https://localhost:10011/eureka
routes:
- gatewayUrl: /api/v1
serviceRelativeUrl: /api/v1
apiInfo:
- apiId: org.zowe.hwexpress
gatewayUrl: "api/v1"
swaggerUrl: https://localhost:10020/swagger.json
catalogUiTile:
id: cademoapps
title: Sample API Mediation Layer Applications
description: Applications which demonstrate how to make a service integrated to the API Mediation Layer ecosystem
version: 1.0.0
instance:
app: hwexpress
vipAddress: hwexpress
instanceId: localhost:hwexpress:10020
homePageUrl: https://localhost:10020/
hostName: 'localhost'
ipAddr: '127.0.0.1'
secureVipAddress: hwexpress
port:
$: 10020
'@enabled': false
securePort:
$: 10020
'@enabled': "true"
dataCenterInfo:
'@class': com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo
name: MyOwn
metadata:
apiml.catalog.tile.id: 'samplenodeservice'
apiml.catalog.tile.title: 'Zowe Sample Node Service'
apiml.catalog.tile.description: 'NodeJS Sample service running'
apiml.catalog.tile.version: '1.0.0'
apiml.routes.api_v1.gatewayUrl: "api/v1"
apiml.routes.api_v1.serviceUrl: "/api/v1"
apiml.apiInfo.0.apiId: org.zowe.hwexpress
apiml.apiInfo.0.gatewayUrl: "api/v1"
apiml.apiInfo.0.swaggerUrl: https://localhost:10020/swagger.json
apiml.service.title: 'Zowe Sample Node Service'
apiml.service.description: 'The Proxy Server is an HTTP HTTPS, and Websocket server built upon NodeJS and ExpressJS.'
ssl:
certificate: ssl/localhost.keystore.cer
keystore: ssl/localhost.keystore.key
caFile: ssl/localhost.pem
keyPassword: password
Start your Node.js service and verify that it registers to the Zowe API Mediation Layer.
FAQs
NodeJS enabler for Zowe API Mediation Layer
The npm package @zowe/apiml-onboarding-enabler-nodejs receives a total of 114 weekly downloads. As such, @zowe/apiml-onboarding-enabler-nodejs popularity was classified as not popular.
We found that @zowe/apiml-onboarding-enabler-nodejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.