Questions tagged [loopbackjs]

LoopBack is an open source Node.js framework built on top of Express.js 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 JavaScript, iOS, and Android SDKs.

The LoopBack framework is a set of Node.js 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 iOS, Android, and HTML5.

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.

See also

2853 questions
13
votes
3 answers

PayloadTooLargeError on loopback 3

I need to save base64 image in loopback model. When i'm saving base64 image i get an error saying . I have tried updating in middleware same added below, i have done it before in loopback2, for this project i upgraded to loopback3 and got stuck in…
Taj Ahmed
  • 895
  • 11
  • 19
13
votes
1 answer

How to setup OAuth 2.0 server using loopback

I want to setup an OAuth 2.0 Server using Loopback using a package called loopback-component-oauth2 The documentation is here : https://docs.strongloop.com/display/public/LB/OAuth+2.0#OAuth2.0-UsingtheOAuth2component But it is very unclear, what…
nikhil.g777
  • 882
  • 3
  • 12
  • 24
13
votes
2 answers

Creating Permanent AccessToken in loopback

How to create a permanent access token for a StrongLoop API. Now for every user login it creates an access token. And unnecessary entry in my db I can increase the validity of access token(ttl) as mentioned here. But still it will generate for new…
Rameez
  • 601
  • 1
  • 8
  • 22
13
votes
3 answers

What does 'cb' mean in loopback?

I am trying to learn loopback but I don't really understand what 'cb' means in function call. I read this In loopback documentation what does variable 'cb' stands for? and I have basic understanding of callback in nodejs but I just don't understand…
Ken Kwok
  • 388
  • 3
  • 19
13
votes
2 answers

Loopback passport mobile login

I'm developing an API with loopback and passport. I've seen this example, which is quite good: https://github.com/strongloop/loopback-example-passport In the documentation, they say loopback follows this step to authenticate users via third party…
danielrvt
  • 10,177
  • 20
  • 80
  • 121
13
votes
4 answers

Sequelize orm vs Loopback orm

I'm creating rest api backed by PostgreSQL. I like Strongloop Loopback framework, it streamlines api development. But how its built-in orm compared to sequelize? What advanced features has sequelize as dedicated sql orm, which are missing in…
rus1
  • 572
  • 5
  • 10
13
votes
2 answers

How Can I Create a Loopback Remote Method with a Model Schema?

I'm currently building a loopback application, which only has a single model named Phone. Here's my common/models/phone.js code: module.exports = function(Phone) { // Return a random phone's data. Phone.random = function(callback) { return…
rdegges
  • 32,786
  • 20
  • 85
  • 109
13
votes
2 answers

How do I get a hold of a Strongloop loopback model?

This is maddening, how do I get a hold of a loopback model so I can programmatically work with it ? I have a Persisted model named "Notification". I can interact with it using the REST explorer. I want to be able to work with it within the server,…
Warren
  • 735
  • 7
  • 19
12
votes
5 answers

How to set custom schema for custom remote methods on Strongloop

I'm newbie on Strongloop and I can't find information for how to customize my response class (model schema for a object I built) and I don't know how to show on the API explorer the object with custom data. For example, I have a custom remote…
jrltt
  • 651
  • 10
  • 23
12
votes
1 answer

Using JWT for Loopback authentication

I'm trying to understand how I can fit a custom JWT routing into loopbacks security model. My application has an authentication "dance" involving SMS that results in a valid JWT token using the excellent description. I'm using the jsonwebtoken and…
stwissel
  • 20,110
  • 6
  • 54
  • 101
12
votes
2 answers

Difference between swagger and loopback for Rest API

Swagger helps in creating Restful Api, I get that. Where would you use LoopBack, is this another tool for creating Rest api. LoopBack has support swagger 2.0. I am confused here, can they be used interchangeably.
anivas
  • 6,437
  • 6
  • 37
  • 45
12
votes
2 answers

Modify image obtained from loopback-component-storage

I am using loopback for storing Image to the server. I want to modify the file name of the file before getting saved to the server. Also I want to convert it to another thumbnail form before getting saved. Here is how I am doing. At client…
Robins Gupta
  • 3,143
  • 3
  • 34
  • 57
12
votes
2 answers

LoopBack Remote Methods and Access to Model Data

I've been working on this for hours and I'm completely lost, because the loopback documentation is not helpful. I'm trying to write application logic into a model. The documentation for that is here. Unfortunately, the example doesn't demonstrate…
Michael.Lumley
  • 2,345
  • 2
  • 31
  • 53
12
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,795
  • 2
  • 20
  • 35
12
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,633
  • 17
  • 57
  • 104