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
1
vote
2 answers

Loopback change Content-Type in a remote method

I need to find a way to change the content type of a response I'm sending from a custom remote method. It seems that by default it's application/json. I have a remote method that returns images, so it i need somehow to change the Content-Type.
ppoliani
  • 4,792
  • 3
  • 34
  • 62
1
vote
2 answers

Loopback get http context in an overriden built-in method

I want to use a custom endpoint for POST /images; so what i thought i could override the create method of a model; this is how I'm doing it: var loopback = require('loopback'); function overrideImageApiMethods(app){ var Image =…
ppoliani
  • 4,792
  • 3
  • 34
  • 62
1
vote
1 answer

Create model in model

I'm new to strongloop and look at documentation and samples but never see my problem as desired. I'v two models, sentence.js and log.js and making post request a sentence from mobile app to rest-api, for example Model sentence.js (dont want save to…
blackkara
  • 4,900
  • 4
  • 28
  • 58
1
vote
1 answer

LoopBack: "order" filter not always applied

I have a model that uses the memory connector. On the client side the REST-API request looks like this: TrackedAircraft.find({ filter: { order: 'altitude ASC', where: { altitude: { neq: null }} } }).$promise.then(function (results) { …
Chris
  • 460
  • 10
  • 22
1
vote
1 answer

Redirection after the login succeeds or fails in loopback framework

I have recently started with loopback framework and made a simple login functionality by creating a 'customer' model inheriting from base 'User' like this: CUSTOMER.JSON { "name": "customer", "base": "User", "idInjection": true, …
beNerd
  • 3,314
  • 6
  • 54
  • 92
1
vote
2 answers

Weird behaviour of loopbackJS with AngularJS

I set html5mode(true) in my app.js. My code is as follows $routeProvider.when( '/hello/there', { templateUrl: 'partials/hello.html', controller : 'HelloCtrl' } ); // if none of the above routes are met, use this fallback // which executes the…
Nur Rony
  • 7,823
  • 7
  • 38
  • 45
1
vote
2 answers

RemoteHooks with wildcards doen't work in storage container

I am using Loopback storage service for file uploads, it works fine. I want to do post-processing for uploaded files, so I added remote hooks methods beforeRemote and afterRemote. When i use '*' for method name it works. When I change it to 'upload'…
Kulver B.
  • 13
  • 2
1
vote
1 answer

SLC Loopback: Using model instance from within a model hook

With loopback model hooks, I know you can get access to an instance of a model like User before it is created by using beforeCreate: User.beforeCreate = function(next, userInstance) { //your logic goes here using userInstance next(); }; But if…
smstromb
  • 586
  • 2
  • 7
  • 19
1
vote
2 answers

Node/Nginx, 413 request entity too large, client_max_body_size set

Pretty similar to https://serverfault.com/questions/539466/413-request-entity-too-large-client-max-body-size-is-set I've got a Node server (using Loopback) running on top of nginx (to be specific, the dockerfile/nginx image), but whenever I do a…
dchang
  • 2,440
  • 4
  • 24
  • 27
1
vote
1 answer

AND/OR for roles in Loopback's ACLS

I have an application where users can have several of different type of roles Static Roles: each determines a different level of permissions, a user is mapped to one of these roles adminUser powerUser baseUser Dynamic Role: accountMember: this…
NicolasMoise
  • 7,261
  • 10
  • 44
  • 65
1
vote
1 answer

Using Push Notications in Strongloop

I am trying to add push notification support to a REST server build in Strongloop / Loopback. I have followed the instructions at http://docs.strongloop.com/display/public/LB/Push+notifications, but it fails. It seems to be due to the line that…
johnmac
  • 166
  • 1
  • 7
1
vote
1 answer

Loopback.io and CouchDB connector

I am trying to explore the opportunity to build a connector for CouchDB for Loopback.io. I know CouchDB has a REST interface but - for some reason - when putting the baseURL of my Couch local server into a Rest connector in Loopback, I get an error…
Matteo
  • 11
  • 3
1
vote
2 answers

Loopback strange behaviour

I am talking about loopback push component. I am trying to intercept the "create" method of "Installation" model. My code looks like this - server/boot/installationex.js module.exports = function (app) { var Installation =…
Jahid Shohel
  • 1,395
  • 4
  • 18
  • 34
1
vote
4 answers

Loopback lb-ng (LoopBack Angular SDK command-line tool) not working

I'm going through the tutorials of http://docs.strongloop.com, and I've reached http://docs.strongloop.com/display/public/LB/Add+a+client+app. Yet when I execute 'lb-ng ../server/server.js js/lb-services.js' I get an error: Cannot find module…
Ana M
  • 657
  • 6
  • 9
1
vote
1 answer

Loopback where -> like query

I am using loopback 1.0 http://localhost:3000/api/cvp/profiles?filter={"where": {"profileId": {"like" : "%1214%"}}} Causes a syntax error: "message": "Unexpected token %" This query works fine if i omit the % characters, however the result is a…
jport
  • 23
  • 3