
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
node-sap-app-server
Advanced tools
SAP simple configuration driven application server based on Express
SAP Application Server encapsulates all the complex logic of server initialization (database connection, dynamic service loading, Express application creation and configuration...). Everything is based on a server configuration JSON file.
Only a few lines of code are required to create an executable application
var path = require('path');
var Server = require('node-sap-app-server').Server;
Server.start(path.join(__dirname, 'config.json')); // use absolute path for config file
The server configuration file is a JSON file made of a number of sections, each section being a JSON object or the path to the JSON file containing the section definition (paths are relative to the configuration file). You may refer to the SAP configuration file for a comprehensive example.
##db This section defines the connection parameters to MongoDB
##debug This section controls the activation of various debug features (currently only live-reload)
##deployment This section controls the SAP deployment strategy in MongoDB through the strategy parameter
##env This section allows a simple definition of environment variables which will be set on the node process (e.g. setting NODE_ENV to 'production').
##http This section defines some HTTP server parameters
###http.proxy proxy subsection of http section defines global proxy configuration for outbound http calls
###http.express express subsection of http section defines Express configuration parameters
####http.express.app
Defines Express application settings. app.set(key, value) will called for each (key, value) pair
###http.tls Defines TLS configuration for the server, cf. http://nodejs.org/api/tls.html
####http.tls.cwd Defines the base path to resolve certificate and key files (default is config.json location)
####http.tls.pfx Path to a file containing the private key, certificate and CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with the key, cert and ca options.)
####http.tls.key Path to a file containing the private key of the server in PEM format.
####http.tls.passphrase A string of passphrase for the private key or pfx.
####http.tls.cert Path to a file containing the certificate key of the server in PEM format. (Could be an array of file paths).
####http.tls.ca A file location or an array of file locations for the server trusted certificates in PEM format. If this is omitted several well known "root" CAs will be used, like VeriSign. These are used to authorize connections.
####http.tls.crl A file location or an array of file locations for the pointing to PEM encoded CRLs (Certificate Revocation List)
##logging This section defines the server logging configuration
##server This section defines server parameters
##services This section defines the list of server services to load and the mount point of their http handlers.
For each server module, you should define a mounting configuration
###SAP module API A SAP server module.exports should return an object exposing the following optional methods
###Mounting configuration Mounting configuration may be a string containing the path at which all module handlers will be mounted (convenient for services exposing a single handler) or a hash defining for each handler name the mounting path.
###Synchronous/Asynchronous callbacks Apart from the getHandlers callback which is always synchronous, all callback may be either synchronous or asynchronous. If the method exposed by the service takes no parameter it must be a synchonous one. Otherwise, it is considered asynchronous and must take as unique parameter a standard callback function cb(err). In that case, the server will pause and wait for the callback before resuming initialization.
##web This section controls the static web content
#3 Schema operations
It’s possible to start the server so to run some schema operations: checkSchema, initSchema, upgradeSchema
var path = require('path');
var AppServer = require('node-sap-app-server');
var server = new AppServer.Server(path.join(__dirname, 'config.json'));
server.checkSchema()
Once the operation is completed, the server is shut down.
When running checkSchema, if implemented by services, these methods are called in this order: checkSchema(), then onSchemaChecked()
When running initSchema: initSchema(), then onSchemaInitialized(), then checkSchema(), then onSchemaChecked()
When running upgradeSchema: prepareUpgrade(), then upgradeSchema(), then onSchemaUpgraded(), then checkSchema(), then onSchemaChecked()
FAQs
SAP application server component
We found that node-sap-app-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.