![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Start with a complete Koa server with zero configuration.
Apj includes Koa packages:
npm install apj --save
const Apj = require('apj');
new Apj().start(); // Listen on http://localhost:3000
Add routes
const app = new Apj();
app.router.get('/my-route', ctx => {
ctx.body = 'hello';
});
app.start();
Use middleware
new Apj({
use: [
async (ctx, next) => {
const start = Date.now();
await next();
const ms = Date.now() - start;
console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
}
]
});
Kind: global class
object
Create instance
Param | Type | Default | Description |
---|---|---|---|
[opt] | object | options | |
[opt.host] | string | "localhost" | host |
[opt.port] | number | 3000 | port |
[opt.serverOptions] | object | server options | |
[opt.helmetSettings] | object | koa-helmet settings | |
[opt.routerSettings] | object | koa-router settings | |
[opt.bodySettings] | object | koa-body settings | |
[opt.successSettings] | object | koa-json-success settings | |
[opt.structSettings] | object | koa-struct settings | |
[opt.cacheSettings] | object | koa-incache settings | |
[opt.corsSettings] | object | @koa/cors@2 settings | |
[opt.sessionSettings] | object | koa-session settings | |
[opt.viewsSettings] | object | koa-views settings | |
[opt.loggerSettings] | object | koa-logger settings | |
[opt.logger] | object | false | active koa-logger |
[opt.ctx] | object | Koa context | |
[opt.viewsPath] | string | "./views/" | path to views |
[opt.staticPath] | string | "./public/" | path to static resources |
[opt.use] | array | array of middleware | |
[opt.autoStart] | boolean | false | start on create |
[opt.responseErrorHandler] | boolean | manipulate message and code | |
[opt.exposeError] | boolean | expose all errors |
Apj
Start server app
Kind: instance method of Apj
Emits: start
Param |
---|
port |
Apj
Stop server app
Kind: instance method of Apj
Emits: stop
Triggered on server start
Kind: event emitted by Apj
Triggered on server stop
Kind: event emitted by Apj
object
Apj instance
Kind: inner typedef of Apj
Properties
Name | Type | Description |
---|---|---|
app | object | Koa instance |
router | object | router object |
server | object | server instance |
You can view the changelog here
Apj is open-sourced software licensed under the MIT license
FAQs
Start with a complete Koa server with zero configuration.
The npm package apj receives a total of 3 weekly downloads. As such, apj popularity was classified as not popular.
We found that apj 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.