mysql-restapi is a Node.js module (v1.2.6, last updated in 2020) that bridges MySQL databases and REST APIs using Express. It auto-generates CRUD endpoints for any table, supports custom SQL queries, CORS configuration, and optional login field validation. Unlike ORM-based solutions, it requires manual Express and mysql setup but offers simple API URL customization with limit, order, and field filtering query parameters. Maintenance is low, with minimal updates and no active development.
npm install mysql-restapiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a basic Express server with mysql-restapi, exposing CRUD APIs for any MySQL table.
Run npm install express mysql --save before or alongside mysql-restapi.
Ensure you call mysqlrestapi(app, dbconfig) correctly.
Install mysql (version 2.x) specifically: npm install mysql --save
Use additional middleware like helmet and express-validator for production.
Verify installation: const mysqlrestapi = require('mysql-restapi'); and that the package is in node_modules.Run: npm install mysql --save
Create connections.js in the same directory as your main file, exporting an object with connection, settingOptions, corsOptions.