Questions tagged [loopbackjs]

LoopBack is an open source Node.js framework built on top of Express optimized for mobile, web, and other devices. Connect to multiple data sources, write business logic in Node.js, glue on top of your existing services and data, build REST APIs and connect using JS, iOS & Android SDKs.

The LoopBack framework is a set of modules that you can use independently or together. An application interacts with data sources through the LoopBack model API, available locally within Node.js, remotely over REST, and via native client APIs for , , and . Using these APIs, apps can query databases, store data, upload files, send emails, create push notifications, register users, and perform other actions provided by data sources and services. Clients can call LoopBack APIs directly using Strong Remoting, a pluggable transport layer that enables you to provide backend APIs over REST, WebSockets, and other transports.

Source: https://github.com/strongloop/loopback

Documentation: http://docs.strongloop.com/display/LB/LoopBack

Debugging: https://loopback.io/doc/en/lb3/Setting-debug-strings.html

2851 questions
11
votes
5 answers

Loopback model CURRENT_TIMESTAMP

I have a model like this - { "name": "MakeCallTestConfiguration", "base": "PersistedModel", "idInjection": true, "properties": { "id": { "type": "number", "id": true, "generated": true }, "destination": { …
Jahid Shohel
  • 1,155
  • 4
  • 14
  • 32
11
votes
2 answers

Execute raw query on MySQL Loopback Connector

How is it possible to execute raw query and expose results through REST API with strongloop? I've read something about using hooks and dataSource.connector.query() but I cannot find any working examples.
marka.thore
  • 2,677
  • 2
  • 16
  • 34
11
votes
4 answers

Loopback discoverAndBuildModels not generating models

I'm trying to get Loopback to discover and build my first table. I've used the simple example on their page at the bottom here: http://docs.strongloop.com/display/LB/Database+discovery+API#DatabasediscoveryAPI-Exampleofbuildingmodelsviadiscovery and…
Organiccat
  • 5,555
  • 17
  • 54
  • 98
11
votes
2 answers

How to set up the ACL to allow everyone list all the Users from the REST API

Im trying to list all the Users in my loopback 2.0 app using the REST API and I'm getting the following error: { "error": { "name": "Error", "status": 401, "message": "Authorization Required", "statusCode": 401, "stack":…
jpcapdevila
  • 175
  • 2
  • 8
11
votes
1 answer

Login by facebook in angular app with loopback backend

I'm making an angular application with strongloop loopback backend. Also I integrating a third party login by facebook using loopback-passport module. everything was fine in loopback-example-passport and everything is fine in my app right before the…
chilicoder
  • 279
  • 3
  • 17
10
votes
4 answers

How to automigrate in Loopback

I have renamed a number of models and tables in my loopback application, however I must now migrate to this model definition. I need to run autoMigrate(). It must be run on a dataSource object but the documentation provides no help regarding…
JD.
  • 1,691
  • 4
  • 20
  • 36
10
votes
2 answers

Strongloop app does not load local datasource

I want to use different environment specific datasource configurations in a Strongloop app. I saw at https://docs.strongloop.com/display/public/LB/Environment-specific+configuration that the priority of configurations are: Environment-specific…
Sanandrea
  • 2,062
  • 1
  • 24
  • 44
10
votes
2 answers

Port timeout deploying Loopback app to Heroku

I deployed an Loopback app to Heroku, but it keeps crashing with error Web process failed to bind to $PORT within 60 seconds of launch I know it could be connected to the dynamic port of Heroku, so I set my port to the process environment one…
pasine
  • 10,442
  • 9
  • 44
  • 75
10
votes
1 answer

Loopback: Embedded Model is not working in offline sync

I have followed the loopback offline sync example and create my own model with embedded document. I created a Model named Project where ProjectMembers are embedded model. Here are my model: Project.json { "name": "Project", "base":…
fyasir
  • 2,620
  • 2
  • 20
  • 34
10
votes
3 answers

Loopback MongoDB String Property Converted to ObjectId When Using Find Where Clause

I have a model with a number of properties. One of those is a field named "developerId" that contains a string which has the same length and characteristics as a MongoDB ObjectId (it is in fact a stringified ObjectId). When I query the model with…
Rob Evans
  • 6,066
  • 3
  • 35
  • 52
10
votes
1 answer

Loopback testing with memory as datasource

I'm trying to use the memory-connector as a datasource when doing integration testing. But it seems to always connect to the mongodb-datasource. One major hack i have done is to change the datasource for each model to memory. But there must be a…
Are Almaas
  • 1,023
  • 12
  • 25
9
votes
1 answer

Loopback Email Connector not sending emails

I have a Loopback Application with a REST API. I want to make a REST API Enpoint /Email/sendEmail which sends an email. I did this tutorial: https://loopback.io/doc/en/lb3/Email-connector.html, but it's not working for me somehow. When I open…
BlockchainProgrammer
  • 1,333
  • 2
  • 11
  • 30
9
votes
3 answers

Can I use non-sequential id for loopback model?

Loopback uses sequential number for model ID. Can I use my own ID generator on server side? How do I go about doing that?
Sam
  • 1,167
  • 11
  • 20
9
votes
1 answer

Override GET or any default method on strongloop

I need to override the GET on strongloop. So when I GET foo/ it returns something different as the default one. I tried using remoteMethod with http: {path: '/', verb: 'get'} without success. How can I override any default method on strongloop?
perseus
  • 1,262
  • 1
  • 13
  • 21
9
votes
1 answer

Loopback: Passing multiple object types in a remote method

I have an issue where when I pass two object types as a remote method argument, the first argument gets overwritten by the second argument. Below is code and results. How could I go about not having the second argument not overwrite the first…
emarel
  • 271
  • 5
  • 22