{"id":15137,"library":"loopback","title":"LoopBack 3.x Framework","description":"LoopBack 3.x is an open-source Node.js framework designed for rapidly creating dynamic end-to-end REST APIs with minimal coding. It facilitates data access from a wide array of databases, including Oracle, MySQL, PostgreSQL, MS SQL Server, and MongoDB, and supports incorporating complex model relationships and robust access controls. The framework also offers built-in services for mobile application development, such as push notifications, geolocation, and file storage. The current stable version for LoopBack 3 is 3.28.0, but it is in Maintenance LTS (Long Term Support) mode, having passed its official End-Of-Life (EOL) in December 2020. Consequently, only critical bugs and security fixes are provided for this version, and users are strongly encouraged to migrate to LoopBack 4, which represents the actively developed and supported iteration of the framework. LoopBack 3 applications are typically built using its collection of Node.js modules, Yeoman generators for scaffolding, and client SDKs.","status":"maintenance","version":"3.28.0","language":"javascript","source_language":"en","source_url":"https://github.com/strongloop/loopback","tags":["javascript","web","restful","rest","api","express","restify","koa","auth"],"install":[{"cmd":"npm install loopback","lang":"bash","label":"npm"},{"cmd":"yarn add loopback","lang":"bash","label":"yarn"},{"cmd":"pnpm add loopback","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for connecting to data sources and defining models; moved from peerDependencies to direct dependencies in LoopBack v3.","package":"loopback-datasource-juggler","optional":false}],"imports":[{"note":"LoopBack 3.x primarily uses CommonJS module syntax due to its release era. The 'loopback' object is the primary entry point for the framework.","wrong":"import loopback from 'loopback';","symbol":"loopback","correct":"const loopback = require('loopback');"},{"note":"The base Model class is accessed as a property of the main `loopback` application object, not as a direct named export.","wrong":"import { Model } from 'loopback';","symbol":"app.Model","correct":"const MyModel = loopback.Model.extend('MyModel', { /* ... */ });"},{"note":"Application bootstrapping is handled by the separate `loopback-boot` package, which takes the main `loopback` app instance as an argument.","wrong":"loopback.boot(app, __dirname);","symbol":"app.boot","correct":"const boot = require('loopback-boot');\nboot(app, __dirname, function(err) { /* ... */ });"}],"quickstart":{"code":"const loopback = require('loopback');\nconst boot = require('loopback-boot');\nconst path = require('path');\n\nconst app = module.exports = loopback();\n\napp.start = function() {\n  // Start the web server\n  return app.listen(function() {\n    app.emit('started');\n    const baseUrl = app.get('url').replace(/\\/$/, '');\n    console.log('Web server listening at: %s', baseUrl);\n    if (app.get('loopback-component-explorer')) {\n      const explorerPath = app.get('loopback-component-explorer').mountPath;\n      console.log('Browse your REST API at %s%s', baseUrl, explorerPath);\n    }\n  });\n};\n\n// Bootstrap the application (configures models, datasources, middleware)\nboot(app, __dirname, function(err) {\n  if (err) throw err;\n\n  // Start the server if `$ node server.js` is run directly\n  if (require.main === module) {\n    app.start();\n  }\n});\n\n// Example: Define a simple root endpoint\napp.get('/', (req, res) => {\n  res.send('LoopBack 3.x application is running!');\n});","lang":"javascript","description":"This quickstart initializes a basic LoopBack 3.x application, sets up the server to listen on a port, and defines a simple root endpoint. It demonstrates the fundamental structure of a LoopBack 3 `server.js` file, using `loopback` and `loopback-boot` to start the application."},"warnings":[{"fix":"Plan and execute migration of applications to LoopBack 4, which is the current and actively developed version of the framework. Refer to the official migration guide at `loopback.io/doc/en/lb4/migration-overview.html`.","message":"LoopBack 3.x is in Maintenance LTS mode and has passed its End-Of-Life (EOL) date in December 2020. It receives only critical bug fixes and security patches. New feature development and active support have ceased.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Ensure `loopback-datasource-juggler` is correctly listed as a direct dependency in your `package.json` and installed via `npm install` or `yarn add`.","message":"The `loopback-datasource-juggler` package, which is core to LoopBack's data handling, was moved from `peerDependencies` to `dependencies` in LoopBack 3.0. This might affect existing project setups that relied on `peerDependencies` behavior.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Thoroughly review the LoopBack 3.0 Release Notes and Migration Guide at `loopback.io/doc/en/lb3/3.0-Release-Notes.html` and `loopback.io/doc/en/lb3/Migrating-to-3.0.html` before upgrading.","message":"Major breaking changes exist between LoopBack 2.x and 3.0. These include API changes, configuration updates, and dependency shifts requiring careful migration.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade to the latest available patch version of LoopBack 3.x (e.g., 3.28.1 or higher) to ensure `querystring.stringify` is correctly used for link generation.","message":"Older versions of LoopBack 3.x had a bug in `User.prototype.verify` that incorrectly concatenated query-string components, potentially leading to malformed verification links or unexpected redirect behavior.","severity":"gotcha","affected_versions":"<=3.28.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Install it explicitly: `npm install loopback-datasource-juggler` or ensure it's in your `package.json` dependencies and run `npm install`.","cause":"The core `loopback-datasource-juggler` package is missing from your project's `node_modules`.","error":"Error: Cannot find module 'loopback-datasource-juggler'"},{"fix":"Ensure `loopback-boot` is installed (`npm install loopback-boot`) and then require and use it: `const boot = require('loopback-boot'); boot(app, __dirname, callback);`","cause":"You are attempting to call `app.boot` directly, but `boot` is a function exported by the separate `loopback-boot` package, not a method on the `loopback` app object.","error":"TypeError: app.boot is not a function"},{"fix":"Enable CORS middleware in your `server.js` or `middleware.json` by adding `app.use(loopback.cors());` or configuring it in `middleware.json`.","cause":"Cross-Origin Resource Sharing (CORS) is not properly configured or enabled on your LoopBack API server, preventing requests from different origins.","error":"Access to XMLHttpRequest at 'http://localhost:3000/api/models' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."}],"ecosystem":"npm"}