Examples
Examples
GitHub Repository
Full examples are available in the ContractShield repository:
git clone https://github.com/zeekmartin/contractshieldcd contractshield/examplesAvailable Examples
| Example | Description |
|---|---|
express-basic | Basic Express.js setup |
fastify-webhooks | Fastify with Stripe webhooks |
sidecar-java | Java app with sidecar |
kubernetes | Full Kubernetes deployment |
Express Basic
import express from 'express';import { contractshield } from '@cshield/pep-express';
const app = express();app.use(express.json());app.use(contractshield({ policy: './policy.yaml' }));
app.post('/api/orders', (req, res) => { res.json({ orderId: crypto.randomUUID() });});
app.listen(3000);