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
5
votes
0 answers

NPM postinstall Error on Dependency core-js Trying to Run on Docker

I'm getting this error specifically on RUN npm install on Dockerfile: > core-js@2.6.11 postinstall /app/node_modules/core-js > node -e "try{require('./postinstall')}catch(e){}" The command '/bin/sh -c npm install' returned a non-zero code: 1 When…
Mon
  • 1,010
  • 1
  • 11
  • 19
5
votes
0 answers

Custom validation response object in loopback4?

I have added validation rules on a model in loopback. Validations are working fine but the response message i get is somewhat automatically generated. I need to send a custom response object based on a validation. My model validation is multiploof…
TechChain
  • 8,404
  • 29
  • 103
  • 228
5
votes
5 answers

loopback "lb4" command is not working after successfully installation of loopback CLI using "npm i -g @loopback/cli"

I have successfully installed loopback CLI using npm i -g @loopback/cli after that I'm trying to create app using lb4 app command terminal and it shows me Command 'lb4' not found. Only lb app works for version 3 and 2 but I want to create…
ranjit redekar
  • 919
  • 1
  • 12
  • 24
5
votes
4 answers

loopback REST API filter by nested data

I would like to filter from REST API by nested data. For example this object: [ { "name": "Handmade Soft Fish", "tags": "Rubber, Rubber, Salad", "categories": [ { "name": "women", "id": 2, "parent_id": 0, …
JanuszO
  • 1,140
  • 12
  • 25
5
votes
0 answers

Loopback | command line argument for loading data

For my Loopback project, I need to load a huge data set from csv. Boot script takes nearly 30s to complete the data load. so its not an option. My plan is to load data only when loop back is started with some argument. like node . --load-data or…
Sheik797
  • 435
  • 4
  • 16
5
votes
2 answers

Loopback 4/MongoDB - Foreign key not converted to ObjectID

I am trying to set up an hasMany relation using a Mongo database. I have followed the guide to create an hasMany relation in the loopback 4 documentation (https://loopback.io/doc/en/lb4/HasMany-relation.html) and tryied to set differents properties…
FabienCH
  • 51
  • 5
5
votes
3 answers

NodeJS: Why is there a two hour difference in new Date()?

I am doing a console.log(process.env.TZ); console.log(new Date()); It outputs Europe/Amsterdam 2018-09-02T08:07:03.842Z But the current time is 10:07 not 08:07. The actual problem is that when I save a model to the db, it somehow gets converted…
xfscrypt
  • 16
  • 5
  • 28
  • 59
5
votes
0 answers

MaxListenersExceededWarning - Loopback

I am getting the following error: (node:18591) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit. after a script for sending push notifications is…
Phoenix Dev
  • 457
  • 5
  • 19
5
votes
1 answer

Loopback 3. Custom roles not working

I have a Client model that inherits the built-in User model. I have created a custom role admin and defined two ACLs using that role for Client model: { "principalType": "ROLE", "principalId": "admin", "permission": "ALLOW", "property":…
Diego Ledesma
  • 1,282
  • 10
  • 27
5
votes
1 answer

Unit testing Loopback models

Using Loopback, we have created some custom remote methods, and we want to unit test that logic. What I am looking to accomplish is to load just one model, not all our models, and unit test the custom remote method(s) for that one model. We can…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
5
votes
4 answers

Best way to define custom functions in loopback api

What is the best way to define custom functions in loopback api that can be used in models defined ? For example a basic express application can have functions in helper folder on root directory, but doing same in loopback is not recommended and…
Dharmendra Yadav
  • 152
  • 1
  • 13
5
votes
1 answer

How to create an API endpoint without a model in Loopback?

I understand we can create remote methods on models which will expose an endpoint. However, is there a way to expose an endpoint without a model? For example, if I want to create an endpoint checks the version of a native app. I don't need a model…
abc123
  • 8,043
  • 7
  • 49
  • 80
5
votes
1 answer

no original function chain to wrap

What does this error mean? I ran basic loopback application with apic loopback emptyapp Then I added babel to use es6 and I get this error just before server listening at http://0.0.0.0:3000 Any advice on the error would be helpful
Jacek Pietal
  • 1,980
  • 1
  • 18
  • 27
5
votes
5 answers

How to auto-restart node app?

I am running a node strongloop application and need for it be auto-restarted if it crashes. what is the best way to auto restart a node application? Also is there anyway to be notified when these crashes occur?
5
votes
1 answer

Loopback Download file

I am following the document for download the file. https://docs.strongloop.com/display/public/LB/Storage+component In that document if download the file means need to follow the url pattern. GET /containers/{container}/files/{file} Example: I have…
RSKMR
  • 1,812
  • 5
  • 32
  • 73