
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
hook.io-restful
Advanced tools
RESTful interface for hook's, provides a RESTful web server for surfaced hooks
A hook to surface chosen hooks to the rest of the world via a RESTful interface. Hooks choose to register and provide documentation details.
curl http://npmjs.org/install.sh | sh
npm install hook.io
npm install hook.io-restful
{
port: 8080, // port to use for HTTP communications
debug: true
}
This hook is very much under construction with many things changing, but wanted to get it up for feedback.
RESTfulReady Notify's RESTfulHook's that a RESTfulServer is available to serve requests.
/* helloWorldHook.js */
var RESTfulHook = require('../../lib/restful').RESTfulHook,
util = require('util');
var helloWorldHook = exports.helloWorldHook = function(options){
var self = this;
RESTfulHook.call(self, options);
self.exports = {};
self.exports._hello = self.hello;
self.exports._hello.description = 'Returns Hello World! if no name is specified or Hello <Name>! if name is specified.';
self.exports._hello.schema = {
name: {
required: false,
validation: 'string',
description: 'The name to return in place of World.',
}
};
self.exports._hello.route = 'hello';
self.exports.sayHello = self.sayHello;
self.exports.sayHello.description = 'Returns Hello World! if no name is specified or Hello <Name>! if name is specified.';
self.exports.sayHello.schema = {
name: {
required: false,
validation: 'string',
description: 'The name to return in place of World.',
}
};
self.exports.sayHelloTo = self.sayHelloTo;
self.exports.sayHelloTo.description = 'Returns Hello World! if no name is specified or Hello <Name>! if name is specified.';
self.exports.sayHelloTo.schema = {
name: {
required: true,
validation: /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/gi,
description: 'The name to return in place of World.',
}
};
};
util.inherits(helloWorldHook, RESTfulHook);
helloWorldHook.prototype.hello = function(data, callback){
if(!(data&&data.name)) callback(null, 'Hello world!');
else callback(null, 'Hello '+data.name);
};
helloWorldHook.prototype.sayHello = function(data, callback){
if(!(data&&data.name)) callback(null, 'Hello world!');
else callback(null, 'Hello '+data.name);
};
helloWorldHook.prototype.sayHelloTo = function(data, callback){
if(!(data&&data.name)) callback({error: 'No name specified'});
else callback(null, 'Hello '+data.name);
};
/* helloWorld.js */
/* This is basically a way to instanciate the helloWorldHook without using .spawn */
#!/usr/bin/env node
var Helloworld = require('./helloWorldHook').helloWorldHook;
var myHook = new Helloworld();
myHook.start();
FAQs
RESTful interface for hook's, provides a RESTful web server for surfaced hooks
The npm package hook.io-restful receives a total of 2 weekly downloads. As such, hook.io-restful popularity was classified as not popular.
We found that hook.io-restful 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.