Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
An advanced modular Web Framework built on Node.
$ npm install bricks
Change directories into the directory that you wish to server files from:
$ bricks
Usage:
Usage: bricks [--help] [--port port] [--ipaddr ipaddr] [--path path] [--log log]
--port port [default 8080]
--ipaddr ipaddr [default 0.0.0.0]
--path path [default "."]
--log log [default none]
var bricks = require('bricks');
var appServer = new bricks.appserver();
appServer.addRoute("/static/.+", appServer.plugins.filehandler, { basedir: "./static" });
appServer.addRoute(".+", appServer.plugins.fourohfour);
var server appServer.createServer();
server.listen(3000);
Routing in bricks
is based on String
matches and truth values. A regular expression
may be passed, as well as a function
that can determine whether or not the route should be executed.
The router
simplified:
if (typeof(route) === 'function') {
var match = route(path);
if (match) {
return true;
}
} else {
if ((typeof(route) === 'string') && path.match(route)) {
return true;
}
}
return false;
There are plugins that are built-in to bricks
that cover basic usage. These plugins are light-weight and loaded as part of the application server. These plugins accept various options for configuration.
Default static file handler. This file handler is for basic functionality, it does not cache.
{
basedir: '/path/to/files/' // default '.'
}
Default 404 handler. By design, this handler simply sets the 404 status code and writes 404 Error
to the requesting browser.
The default redirect handler deals with both temporary and permanent redirects. As with routes
, the path can be a String
, a RegExp
, or a function
. Redirects are sent as temporary
redirects (307) unless denoted as permanent
(301).
{
routes: [
{ path: "^/foo$", url: "http://foo.com/foo", permanent: true },
{ path: new RegExp(/\/bar\/.+/), url: "http://bar.com/bar" }
]
}
Bricks
is a fully baked web application server, but a README can only contain so much information.
For more information and documentation visit bricksjs.com.
FAQs
Bricks Application Server
The npm package bricks receives a total of 4 weekly downloads. As such, bricks popularity was classified as not popular.
We found that bricks 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.