The Router subsystem provides HTTP routing and API endpoint management.
Role: Express.js-based HTTP router
Summary: Provides HTTP routing using Express.js framework with middleware support, route handling, and API management.
Setting | Type | Required | Default | Description |
---|---|---|---|---|
router |
Router | Yes | - | Express Router instance |
baseUrl |
string | Yes | - | Base URL for the router |
Example Configuration:
import { SRE } from '@smythos/sre';
import express from 'express';
const router = express.Router();
SRE.init({
Router: {
Connector: 'ExpressRouter',
Settings: {
router: router,
baseUrl: 'https://api.example.com',
},
},
});
Use Cases:
Role: No-operation router connector
Summary: Provides a null implementation that discards all routing operations. Used when HTTP routing is not needed.
Setting | Type | Required | Default | Description |
---|---|---|---|---|
No specific settings | any | No | - | NullRouter accepts any settings object |
Example Configuration:
import { SRE } from '@smythos/sre';
SRE.init({
Router: {
Connector: 'NullRouter',
Settings: {},
},
});
Use Cases:
How it Works:
http://nullrouter.local