
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
dev-express-static-server
Advanced tools
A simple static server for development mode using Express JS
Note:
npm install --global dev-express-static-server
startup a server instancedev-express-static-server <options>
--port=<port> ( default = 8080 )--dir=<path-to-directory-to-server> ( default = {CWD} )--https=<true/false> [optional] ( default = false )
--https to set it as true--https enabled, --keyPath=<path-to-key.pem-file> [optional] ( default = "{CWD}/key.pem" )--https enabled, --certPath=<path-to-cert.pem-file> [optional] ( default = "{CWD}/cert.pem" )E.g.
dev-express-static-server --port=9092 --https --keyPath="~/dev-certs/key.pem" --certPath="~/dev-certs/cert.pem"
Note:
{CWD} is current directory where the command/util is running from~shutdown a server instancedev-express-static-server --stop --port=<port>
E.g.
dev-express-static-server --stop --port=9092
Note:
--port option is mandatory as PID files will be created using port numbers as ID and using that we will shutdown node process.let server = require("dev-express-static-server/server.js");
server.start(port, [directory, opts]) methodport is required argument
directory - Directory to serve ( default = {CWD} )
opts
opts.useHttps - If true, https server instance will be created, otherwise http will be usedopts.keyPath - If https enabled, path to
key.pem file ( default = {CWD}/key.pem )opts.certPath - If https enabled, path to cert.pem file ( default = {CWD}/cert.pem )opts.onListen - [callback] function which will be invoked once the server starts up successfully and is listening for clients. An object argument with { pid: process.pid } will be passed to the callback. opts = {
onListen: function (args) {
console.log(args.pid);
}
}
opts.onError - [callback] function which will be invoked in case any error happens in server startup. The thrown error will be passed to the callback. opts = {
onError: function (err) {
console.log(err.message);
}
}
opts.onClose - [callback] function which will be invoked once the server is stopped. opts = {
onClose: function () {
console.log("Cleanup !");
}
}
close method, which if called shuts down the serverlet serverInstance = server.start(9092, path.resolve("../app/", {
https: true,
keyPath: path.join("../../dev-certs/key.pem"),
certPath: path.join("../../dev-certs/cert.pem"),
onListen: ...,
onClose: ...,
onError: ...
}) );
// After job done ..
serverInstance.close();
server.kill(processID) methodYou can also kill your server if running in a separate processs and you know its process ID.
Note:
processID is required argumentE.g.
server.kill(9879869);
FAQs
A simple static server for developement using Express JS
We found that dev-express-static-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.