rest-router-model v1.9.5 is a Koa-based REST API generator that automatically creates RESTful HTTP endpoints from a JSON resource configuration, while also handling data model mapping to SQL databases via Knex. It supports PostgreSQL, MSSQL, MySQL, MariaDB, SQLite3, Oracle, and Amazon Redshift. Its key differentiator is the ability to define resource hierarchies (super) and many-to-many relationships (membership) declaratively, reducing boilerplate. The library is in maintenance mode, with last release in 2018, and requires Node >=8.9.0 and Koa. It does not support TypeScript, browser, or GraphQL.
npm install rest-router-modelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Koa app with automatic REST endpoints from a resource config using rest-router-model.
Use const restRouterModel = require('rest-router-model'); then call methods on it.Ensure knexConfig includes client (e.g., 'sqlite3') and connection object.
Use singular resource name in config; do not manually pluralize.
Design resource model with a 'uuid' field or accept auto-generated UUIDs.
Provide all three options: serverName, ip, port.
Ensure .then() is used or await the result.
Set knexConfig.client correctly, e.g., 'mysql'.
Change port in options or kill existing process.