
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@minutemailer/middleman
Advanced tools
Simple request handler for API requests. The goal is to use Middleman to configure global validation and response handlers.
The Middleman has built in handler for these responses:
The appropriate exception will be thrown when any of these statuses is present in the response.
The recommended way is to create a class that extends to Middleman class so you can fully configure it to suit the needs of your app.
The handleSuccess method is a good place to start. A place where you can add redirects
and other defined response rules you might have.
import Middleman from 'middleman';
import Notifications from 'notifications';
class API extends Middleman {
/**
* Handle success responses
* @param {Object} data Minutemailer data
*/
handleSuccess = (data) => {
if ('notifications' in data) {
Notifications.add(data.notification);
}
return data;
};
}
const photos = new API('/api/photos');
photos.get().then(console.log);
FAQs
Simple request handler for API requests.
The npm package @minutemailer/middleman receives a total of 253 weekly downloads. As such, @minutemailer/middleman popularity was classified as not popular.
We found that @minutemailer/middleman 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.