Questions tagged [loopbackjs]

Embrace the flexibility of LoopBack, a cutting-edge Node.js framework designed for seamless performance across diverse platforms including mobiles, webs, and beyond. Empower your applications with the ability to effortlessly link to multiple data sources, develop potent business logic using Node.js language, seamlessly integrate with your existing suite of services and data, assemble REST APIs, all while connecting seamlessly through JavaScript, iOS, as well as Android SDKs.

Unable to access the swagger JSON located at http://localhost:3000/sw-import.js/resources

I'm completely new to the world of node and swagger, so I decided to dive into loopback.io examples in order to build my own API. After successfully installing node and strongloop on my computer, I went ahead and created a fresh loopback application. I qu ...

Encountering a running error in a Strongloop tutorial

I have been reviewing the Strongloop documentation and decided to try out the tutorial on how to Add a client app. I followed all the steps provided and was able to successfully run the app using slc run without encountering any errors. However, upon check ...

Need assistance designing a web interface for managing StrongLoop build and deployment tasks?

I am interested in developing a web user interface for StrongLoop. This UI would allow users to easily build and deploy processes similar to StrongLoop Arc. There are some simple node applications (Web Services) that have not been created using StrongLoop ...

Resolving the CORS preflight issue with Loopback API in Redux

My current setup involves a client application running on React-Redux and an API app on Loopback. During local testing, I have the client app on port 8080 and the server app on port 3000. While attempting to test Google OAuth (using the loopback-passport ...

Try using a distinctive error message when sending a request within a Loopback application

In the development of my Loopback 3 application, I have encountered an issue. My application is sending a post request to an external service. Model.prototype.doSomething() = async()=>{ ... let res = await request.post(that service api).sen ...

Creating a Loopback API that seamlessly integrates with Ember.js

Exploring the use of Loopback to create an API that communicates with Ember. Ember expects JSON data to be enclosed in 'keys', such as for an account: { account: { domain: 'domain.com', subdomain: 'test', title: 'test.domain.com', id: 1 ...

Integration of a unique connector within the Loopback project

Currently, I am in the process of developing a custom loopback (3.25.1) connector I don't require an external module to create this connector as it is a straightforward one that establishes a rabbitmq connection. Within my project, I have a file located ...

When attempting to access the value using this.refs, an error message stating that this.refs is deprecated is

I am attempting to perform a post request using "react-dom": "^15.6.1" to send an object called questions to the database. The data could be structured like this: {description: 'What is E-commerce?', ismeeting: false, expID: '123A2'} My goal is to extrac ...

Encoding URLs for LoopBack applications

I am experiencing an issue with the filter I have: { "fields": {"goal":true,"amountPledged": true,"title": true},"where": {"title": {"like":`%${this.state.searchText}%`}} } The this.state.searchText value is bio. According to my understanding, it should ...

Loopback has a powerful access control feature that encompasses filtering capabilities

I have three models set up in Loopback: Reader, Book, and Note. The Reader model is essentially an instance of User and has the ability to log in. Here are the relationships between the models: Reader has many Books Reader has many Notes Book has many No ...

Issue: Failure to generate models using Loopback's discoverAndBuildModels

I'm currently working on implementing Loopback for table discovery and creation. I have followed the example provided on their documentation page, which can be found at the following link: After executing the code, I am able to see the output of the disco ...

What is the best way to retrieve the worker ID in Loopback?

After executing the command NODE_ENV=production slc run Loopback will initiate workers for each CPU core automatically. I have a piece of code that I only want to run once, but it ends up running in every worker. Is there a way to determine which speci ...

Exploring the OAuth 2.0 integration with OpenID Connect, Loopback, and Keycloak

I'm having trouble establishing a connection to Keycloak from Loopback. I've been experimenting with the keycloak-connect library available at: https://github.com/keycloak/keycloak-nodejs-connect This snippet shows my current implementation in server/bo ...

Authorize a user through Loopback using REST as the data source

I am currently working with a UserModel that is based on the USER model and uses a REST datasource. "UserModel": { "dataSource": "mock", "public": true } Data Source Configuration "mock": { "name": "mock", "baseURL": "http://localhost:3000/", "connector ...

Using PersistedModel.create(Array) will generate an object containing properties that are numbered sequentially

Here is a piece of code that makes a call to a Loopback API method with an array of values. The input data is correct, no errors are thrown by the API, and the subscribe block executes as expected. const newStudentGroups = selectedStudentI ...

Models in Typescript that are interrelated with Loopback

I'm currently working on defining connected models including the HasMany relationship in the context of @types/loopback definitions My approach involves creating an interface for HasMany and its implementation: interface IHasMany { /** ...

Circular Reference: When a model has multiple owners in a belongsTo relationship

I am a beginner with loopback and I am currently exploring ACL implementation. Within my application, I have a "PersistedModel" named 'Page', which has relationships with two other models: 'Employee' and 'Customer'. Both of these models are based on the b ...

Exploring Unanchored Substring Queries in Loopback API

Searching for a solution to implement a basic substring query using the loopback API for a typeahead field. Despite my efforts, I have not been able to find a clear answer. I simply want to input a substring and retrieve all brands that contain that subst ...

Testing loopback routes with supertest, mocha, and data models

In a recent discussion on the deprecation of loopback-testing posted on Google groups, there was a query about demonstrating testing without using loopback-testing. The solution proposed in the conversation suggested utilizing supertest instead. After exp ...

Is it possible for remote Node.js applications to communicate in real-time using full-duplex messaging via WebSockets

With no human involvement, both Endpoint A and Endpoint B are standalone Node.js applications operating independently. Endpoint A is tasked with establishing a secure web socket connection with Endpoint B and ensuring it remains active 24/7. Each endpoin ...

Leveraging Non-RESTful Requests in Loopback (Strongloop)

Our team is currently utilizing Loopback for our REST APIs and we are interested in incorporating some standard Node Express-like calls that won't be automatically routed through the Loopback framework. How can we add a new route without interfering with ...

Retrieve the Request object in Loopback

Currently, I am using Loopback, which is based on Express. In one of my hooks, I need to retrieve the request object as illustrated below: Model.observe('access', function(ctx, next) { console.log(ctx.Model.app.response); if(ctx.query &a ...

How can I access a remote model method within server.js in LoopBack?

My loopback models have a mix of remote methods and non-remote methods. I need to restrict calls in server.js so that only remote methods can be accessed, while denying access to non-remote methods. The code snippet below is from my server.js file. Curren ...

Headers can't be set after they have been sent. This issue arises when calling create(data,cb) function

I am a beginner in Node.js and I am attempting to create a model in MongoDB. However, when I make a call to localhost:3000/a, I notice that the request is being sent twice in the console and I am encountering an error stating "Can't set headers after ...

Tips for creating nested master-detail or master-detail-detail queries in Loopback

My set up includes category and category_subs in a master-detail model, with the post model being linked to category_subs. I have successfully retrieved the master-detail information for both categories, but now I am unsure of how to include the post and e ...

Detecting repeated keys in a query for a REST connector in loopback

Can anyone help me figure out how to duplicate parameters in a loopback REST connector query? Here's the code snippet I'm working with: details: { 'template': { 'method': 'GET', 'debug': true, 'url': 'https://www.example.com/data', ...

Guide on obtaining Loopback 3 conditional 'datasources' and 'model-config': adhering to the provided steps does not yield results

After some tweaking, I managed to make it work partially by assuming that the local variations could only replace already defined structures. This means that I had to initially define the data sources 'DynamoDB' and 'mongo' in datasourc ...

Creating specifications for query parameters in Loopback that are essential for handling CRUD operations

Our journey with Loopback has been successful thus far, but we are now looking to enhance our API documentation by including query parameters. In the swagger.json file, there could be a section that resembles this: { "swagger": "2.0", "i ...

The integration between a Loopback API and MongoDB Atlas encounters a malfunction

There seem to be around 5 unanswered questions of this type. Perhaps someone who has experience can take a moment to share a solution. I currently have a loopback API app running locally, and it successfully connects to mongoDB with the "loopback-connecto ...