
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Haypi will set up a sensible express server for you, and make a lot of things that are needs everywhere globally available
We made a few assumptions to allow a more powerful set of tools:
We are using a superset of the JSON schema spec for validation of input and output data.
You can get the full details of the format at www.github.com/hippopotamus2/json-schema-docs.
The superset allows us to not only validate the data coming in and out, but also allows for role based auth, not only on the route level, but also one each field.
The format for defining the uris is used for building the router.
This means that your schema will be 1:1 with the routes. If you follow REST, this won't cause any problems.
Another assumption that we made is that the controllers should be 1:1 with the routes (and, by association, the schema). Again, if you follow REST, this doesn't pose any problems.
here is an example set up for starting your server with haypi. we recommend using Haypi Skeleton in conjunction with haypi, as it has the intended patterns for working with haypi
'use strict';
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = 'development';
}
let _ = require('lodash');
let haypi = require('haypi');
haypi.name = 'Node Skeleton';
haypi.mode = process.env.NODE_ENV;
haypi.env = require('./env');
haypi.rootUri = '/v1';
haypi.errors = require('./errors');
/* NOTE doing a merge so we don't lose the base helpers in haypi (they can still be overwritten) */
_.merge(haypi.helpers, require('./helpers'));
haypi.interfaces = require('./interfaces');
haypi.schemas = require('./schemas');
haypi.events.on('init', (app, next) => {
haypi.drivers = require('./drivers');
haypi.db = require('./db');
/* NOTE this has to be after all the fns that it requires. probably best to require it last */
haypi.controllers = require('./controllers');
app.get('/status', function (req, res) {
haypi.drivers.pg.query('SELECT 1;').then(() => {
res.send(true);
});
});
next();
});
haypi.start({ port: 3000 });
That's all, and your app will be running with documentation at /docs
and all of the routes hooked to your controller functions.
You can look inside index.js for all the stuff that is setable in the haypi context. You can actually throw anything you want in there. We're not stopping you
FAQs
Easy microservice web framework tools
We found that haypi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.