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
1
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.6.1 to 4.8.0

4

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

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

},
"gitHead": "34fc7dd0ef786606271b845f36802e80eec63e97"
"gitHead": "3b9b3bf69aed462ba336a249e41e349440c61668"
}

@@ -47,2 +47,7 @@ /*

);
if (!this.settings.apiRoot) {
this.settings.apiRoot = '/api';
}
this.plugins = [];
this.routers = [];
}

@@ -62,11 +67,21 @@

newRouter() {
return express.Router();
}
start(input = {}) {
const port = input.port || this.settings.port;
this.app = express();
this.app.use(cors());
this.app.use(express.urlencoded({ extended: false }));
this.app.use(express.json());
for (let i = 0; i < this.plugins.length; i += 1) {
this.app.use(this.plugins[i]);
}
if (this.settings.serveBot) {
this.app.use(express.static(path.join(__dirname, './public')));
}
this.app.use(cors());
this.app.use(express.urlencoded({ extended: false }));
this.app.use(express.json());
for (let i = 0; i < this.routers.length; i += 1) {
this.app.use(this.settings.apiRoot, this.routers[i]);
}
if (port && port > 0) {

@@ -73,0 +88,0 @@ this.app.listen(port, () => {

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