Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nlpjs/express-api-server

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlpjs/express-api-server - npm Package Compare versions

Comparing version 4.23.4 to 4.25.0

6

package.json
{
"name": "@nlpjs/express-api-server",
"version": "4.23.4",
"version": "4.25.0",
"description": "Express API Server",

@@ -28,3 +28,3 @@ "author": {

"dependencies": {
"@nlpjs/core": "^4.23.4",
"@nlpjs/core": "^4.25.0",
"cors": "^2.8.5",

@@ -36,3 +36,3 @@ "express": "^4.17.1"

},
"gitHead": "ad0a639c4cd58735903a21272f7a04a8ace886ab"
"gitHead": "3065165b42ea2160d2a27c10c412c4b4c491332a"
}

@@ -25,2 +25,4 @@ /*

const { defaultContainer, Clonable } = require('@nlpjs/core');
const http = require('http');
const https = require('https');
const ExpressApiApp = require('./express-api-app');

@@ -79,8 +81,36 @@

if (port && port > 0) {
this.server = this.app.listen(port, () => {
if (!port || port < 1) {
return false;
}
let expressServer;
const fs = this.container.get('fs');
let protocol = '';
if (this.settings.key || this.settings.cert) {
try {
expressServer = https.createServer(
{
key: fs.readFileSync(this.settings.key),
cert: fs.readFileSync(this.settings.cert),
},
this.app
);
protocol = 'https';
} catch (error) {
this.container.get('log').error('Error inititlising HTTPS server');
throw error;
}
} else {
expressServer = http.createServer(this.app);
protocol = 'http';
}
this.server = expressServer.listen.apply(expressServer, [
port,
() => {
const logger = this.container.get('logger');
logger.info(`${this.settings.tag} listening on port ${port}!`);
});
}
logger.info(
`${this.settings.tag} listening on port ${port} using ${protocol}!`
);
},
]);
return this.server !== null;

@@ -87,0 +117,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc