
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
hachiware_server_module_callback
Advanced tools
Module for callback when request is received of Web server package "hachiware_server".
A server module for implementing a callback for a request receiving word.
It is a dedicated server module of the web server application "hachiware_server".
To use it, you must first install and configure hachiware_server.
You can install hachiware_server with the following command.
npm i hachiware_server
The server module can be installed with the following npm command.
npm i hachiware_server_module_callback
After installation, you will need the hachiware server configuration file. See here for the procedure for using hachiware_server.
Open the configuration file conf/conf.js etc. on the hachiware server and open it.
Confirm that hachiware_server_module_callback is added in modules.
modules: [
...
"hachiware_server_module_callback",
...
],
Then specify callbacks as shown below.
callbacks: {
access: function(req,res){
if(req.url == "/error"){
throw Error("Error Test 2021");
}
res.write("welcome to server.");
res.end();
},
error: function(exception, req, res){
res.write("ERROR");
res.write(exception.stack.toString());
res.end();
},
},
access is a callback when a request is received,
and error is a callback that is executed when an error occurs in throw etc. after receiving the request.
In access, specify the request object and response object as arguments.
The contents of this object are basically the same as the createServer callback in the http module and the https module.
In the following cases, if you request a URL other than /error, "welcome to server." Will be output and the process will end.
Only when requested by the URL of /error, throw is generated on a trial basis.
....
access: function(req,res){
if(req.url == "/error"){
throw Error("Error Test 2021");
}
res.write("welcome to server.");
res.end();
},
....
In the error callback, the arguments are specified in the order of exception, request object, and response object.
Since error information is included in exception, it can be output when the error is displayed on the screen depending on the debugging status.
...
error: function(exception, req, res){
res.write("ERROR");
res.write(exception.stack.toString());
res.end();
},
...
The life cycle of this server module is as follows:
(server listen start)
|
load fook start
|
(request)
|
load fook access
|
access callback action <= Execute access callback.
|
| * If an error occurs
|
load fook error <= Execute error callback.
|
error callback action
...
|
| * Quit the server
|
load fook end
|
(server listen exit)
hachiware_server_module_callback
A server module for implementing a callback for a request receiving word.
License : MIT License.
Author : Nakatsuji Masato
HP URL : https://hachiware-js.com/
GitHub : https://github.com/masatonakatsuji2021/hachiware_server_module_callback
npm : https://www.npmjs.com/package/hachiware_server_module_callback
FAQs
Module for callback when request is received of Web server package "hachiware_server".
The npm package hachiware_server_module_callback receives a total of 1 weekly downloads. As such, hachiware_server_module_callback popularity was classified as not popular.
We found that hachiware_server_module_callback 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.