
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@anh4n/server
Advanced tools
The server package provides an already configured Node Express server.
npm install @anh4n/server
// index-controller.js
import { Controller } from '@anh4n/server';
export class IndexController {
public init(server) {
server.get('/', this.indexAction);
}
public indexAction(req, res) {
res.send('Hello World');
}
}
// index-controller.js
import { Controller } from '@anh4n/server';
import { exampleInteractor } from '@usecases/example';
export class IndexController {
public init(server) {
server.get('/', this.indexAction);
}
public async indexAction(req, res, next) {
try {
await exampleInteractor();
res.send('Hello World');
} catch (e) {
return next(e);
}
}
}
// index.js
import { Server, initApp } from '@anh4n/server';
import { IndexController } from './index-controller';
initApp(() => {
const app = new Server();
app.addController(new IndexController()); // Register Controller
app.start(); // Start Server
});
This wrapper catches all errors and outputs them formatted.
This method can be used to register a controller on the server.
A middleware can be registered with this method.
See: http://expressjs.com/de/api.html#app.use
If no parameter is given, this method starts the server on port 3000.
Get the Express app.
Get the HTTP server.
FAQs
@anh4n/server
The npm package @anh4n/server receives a total of 16 weekly downloads. As such, @anh4n/server popularity was classified as not popular.
We found that @anh4n/server 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.