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

How to pass node v8 options to sl-pm?

We are using strongloop process manager for running my loopback app on production boxes, and using sl-deploy to deploy the code. We are facing the below issue:- FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory on googling…
Nishant
  • 3,614
  • 1
  • 20
  • 26
7
votes
1 answer

Loopback MongoError: not authorized for query on heroku_xxxx.role

I'm using Loopback for my server with the following setup: "loopback": "^2.36.0", "loopback-boot": "^2.23.0", "loopback-component-explorer": "^2.4.0", "loopback-component-storage": "^1.9.1", "loopback-connector-mongodb":…
denislexic
  • 10,786
  • 23
  • 84
  • 128
7
votes
1 answer

Add a Mongo GeoJSON 2dsphere index on LoopbackJs' attribute GeoPoint

As the title suggests i tried to add a 2dsphere index on my GeoPoints attributes on LoopbackJs. My MongoDB shell version is 3.2.3 - so it should do. Here are my tries so far: Adding enableGeoIndexing in my server/datasource.js { ... "myDs":…
F3L1X79
  • 2,575
  • 2
  • 29
  • 45
7
votes
1 answer

Unit testing for loopback model

I have a Loopback API with a model Student. How do I write unit tests for the node API methods of the Student model without calling the REST API? I can't find any documentation or examples for testing the model through node API itself. Can anyone…
Ajay Kumar
  • 165
  • 2
  • 6
7
votes
2 answers

How to configure loopback to use access_token in the header

I'm using access_token handling logic form loopback. It works fine, but unfortunately expects the access_token in the URL. Can I configure loopback to use the access_token in the header custom field instead?
Aleks
  • 5,674
  • 1
  • 28
  • 54
7
votes
1 answer

Is it possible to generate services for Angular2 from Loopback?

Here is documentation about AngularJS JavaScript SDK This example works perfect for Angular. It is possible to generate Angular client library with command $ lb-ng ../server/server.js js/lb-services.js Does exist same easy way to use Angular2 with…
Nick
  • 9,735
  • 7
  • 59
  • 89
7
votes
2 answers

Hide Node js application source code

I'm developing a private web application for a company and they ask me to use their server to host it. I would like to prevent them the access to the source code. How can i do that? Their server is running debian and they have the root access.. I…
radar155
  • 1,796
  • 2
  • 11
  • 28
7
votes
3 answers

How to configure two different datasource for a model in Strongloop Loopback framework?

Our MySQL database are set up with Write clusters and Read clusters, is there a way to set up Strongloop Loopback Model (e.g. User) to Write to MySQL Host A and Read from MySQL Host B?
Mian Leow
  • 73
  • 1
  • 5
7
votes
1 answer

How integrate loopback third-party login for android

My project includes web and android client. I want to combine Google cross platform sign-in and loopback third-party login. In my scenario, I will never ask username and password. User only uses Google sign-in button for authentication and…
blackkara
  • 4,900
  • 4
  • 28
  • 58
7
votes
1 answer

Adding a filter inside a beforeRemote remote hook

I have a problem I can't find an answer to in Loopback's docs. Say I have a model Company and a modelEmployee. There is an 1Xn relation between the Company and its Employees. When /api/Employees is called, server returns all the employees. I only…
Mihaly KR
  • 2,363
  • 2
  • 19
  • 20
7
votes
1 answer

StrongLoop Loopback : How to customize HTTP response code and header

I'm looking for a way to customize StrongLoop LoopBack HTTP response code and headers. I would like to conform to some company business rules regarding REST API. Typical case is, for a model described in JSON, to have HTTP to respond to POST request…
Nicolas
  • 739
  • 7
  • 7
7
votes
2 answers

Multi-level include filter with LoopBack JS

My problem is that I can't figure out how to get multilevel relations structures in one request with LoopBack backend. I have 3 models: Continent, Country, County. What I would like to do is to GET a continent, and recieve all the countries, and all…
Mihaly KR
  • 2,363
  • 2
  • 19
  • 20
7
votes
3 answers

strongloop loopback how do I serve-static with a route?

I want to do something like // server.js app.use('/client', loopback.static(__dirname + '/../client')) using middleware.json, but the example only works from the root "files": { "loopback#static": { "params": "$!../client" } },
michael
  • 4,377
  • 8
  • 47
  • 73
7
votes
5 answers

Access request headers from beforeSave Model Hook

How can i access the details of the user who raise the request from a Model Hook Comment.beforeSave = function(next,com) { //Want to add 2 more properties before saving com.added_at = new Date(); com.added_by = //How can i set the user id…
Sebastian
  • 4,625
  • 17
  • 76
  • 145
7
votes
2 answers

How to configure StrongLoop LoopBack MongoDB datasource for deployment to Heroku

I'm using LoopBack ver. 1.6 and have a local mongoDB server running for development using he following datasource configuration: "mongodb": { "defaultForType": "mongodb", "connector": "loopback-connector-mongodb", "database":…
user2808320
  • 89
  • 1
  • 3