{"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.","language":"javascript","status":"maintenance","last_verified":"Tue Apr 21","install":{"commands":["npm install loopback"],"cli":null},"imports":["const loopback = require('loopback');","const MyModel = loopback.Model.extend('MyModel', { /* ... */ });","const boot = require('loopback-boot');\nboot(app, __dirname, function(err) { /* ... */ });"],"auth":{"required":false,"env_vars":[]},"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}