Skip to content

Express Middleware

Many Express middleware packages work with Shokupan using the compatibility adapter.

You can use the useExpress adapter to wrap existing Express middleware.

import { Shokupan, useExpress } from 'shokupan';
import helmet from 'helmet';
const app = new Shokupan();
// Use Express middleware
app.use(useExpress(helmet()));
app.listen(3000);

For better performance and deeper integration, use native Shokupan plugins when available:

import { Shokupan, SecurityHeaders, Compression, Cors } from 'shokupan';
const app = new Shokupan();
// Native plugins are faster and context-aware
app.use(SecurityHeaders());
app.use(Compression());
app.use(Cors());
app.listen(3000);
  • Plugins - Native Shokupan plugins