@nura-js/transport-http
v0.2.0
Published
Expose Nura intents over a hardened HTTP router with rate limiting and idempotency
Downloads
5
Maintainers
Readme
@nura-js/transport-http
Expose the Nura intent service over hardened HTTP endpoints with JSON-only enforcement, idempotency, and rate limiting.
Installation
pnpm add @nura-js/transport-httpUsage Example
import express from 'express'
import { registerType } from '@nura-js/intents'
import { buildRouter } from '@nura-js/transport-http'
registerType({
type: 'orders.create',
schema: { type: 'object', required: ['id'], properties: { id: { type: 'string' } } }
})
const app = express()
app.use(buildRouter({
cors: { origins: ['https://yourapp.com'] },
limits: { body: '64kb' },
rateLimit: { windowMs: 60_000, max: 60 }
}))See the module docs for endpoint details.
