Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
route-scout
Advanced tools
A framework that handles the routing for you and makes your server-creating life much easier. Also makes you look younger and more attractive. Results may vary.
A framework that handles the routing for you and makes your server-creating life much easier. Also makes you look younger and more attractive. Results may vary.
Yes.
$ npm install route-scout
Route-Scout relies on the built in http node module as demonstrated below.
const routescout = require('route-scout');
const server = require('http');
routescout.get('/', (req, res) => {
res.write( 'Hello World!' );
res.end();
});
server.createServer(routescout.routes()).listen(9000);
Creates a route for incoming GET requests at the passed in URL, the callback takes two arguments: request and response.
GET requests retrieve data form the server. GET reads.
Creates a route for incoming POST requests at the passed in URL, the callback takes two arguments: request and response.
POST requests are used to send data to the server. POST creates.
Creates a route for incoming PATCH requests at the passed in URL, the callback takes two arguments: request and response.
PATCH requests change data on the server. PATCH updates/modifies
Creates a route for incoming PUT requests at the passed in URL, the callback takes two arguments: request and response.
PUT requests change or replace data on the server. PUT updates/replaces
Creates a route for incoming DELETE requests at the passed in URL, the callback takes two arguments: request and response.
DELETE requests delete data from the server.
Creates a route for whatever you want to create a route for at the passed in URL. The object requires three keys: URL, method and handler. Method must be all uppercase!
Serves static objects from the folder located in path.
var routescout = require( 'routescout' );
// GET Request
routescout.get( '/examplePath', (req, res) => {
res.write ( 'GET request to the homepage.' );
res.end();
});
// POST Request
routescout.post( '/examplePath', (req, res) => {
res.write ( 'POST request to the homepage.' );
res.end();
});
// PATCH Request
routescout.patch( '/examplePath', (req, res) => {
res.write ( 'PATCH request to the homepage.' );
res.end();
});
// PUT request
routescout.put( '/examplePath', (req,res) => {
res.write ( 'PUT request to the homepage.');
res.end();
});
// DELETE Request
routescout.delete( '/examplePath', (req, res) => {
res.write ( 'DELETE request to the homepage.' );
res.end();
});
// CREATE ROUTE Request
routescout.createRoute( {
url: '/example/path',
method: 'HEAD',
handler: (req, res) => {
res.write ( 'HEAD request to the homepage.' );
res.end();
})
});
// Static handler
routescout.static( '/public');
For URL you can add a variable with a : and this will pass it to the request object with a property of params.
// Parameters in the Request object
routescout.get( '/examplePath/:variable', (req, res) => {
res.write ( 'Access variable' + req.params.variable );
res.end();
});
None. We're independent that way :)
FAQs
A framework that handles the routing for you and makes your server-creating life much easier. Also makes you look younger and more attractive. Results may vary.
We found that route-scout 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.