Questions tagged [loopback4]

Questions about LoopBack version 4. Use this tag for LoopBack questions which are specific to only version 4. General LoopBack questions should be tagged with loopbackjs.

Create powerful APIs easily with a new creation experience for defining REST APIs and handling API requests/responses.

A new, improved programming model with dependency injection and new concepts such as components, mixins, repositories, etc. make this the most extensible version yet.

See also

483 questions
1
vote
0 answers

web application using angular 8 and loopback 4

i have developed and deployed web applications using mean stack(using angular 8 version). Now i want to shift to loopback for the backend. The new release version of loopback (loopback 4) does not contain any documentation on how to connect angular…
Anand Prem
  • 51
  • 2
  • 4
1
vote
1 answer

Loopback 4 include nested relations

Recently loopback team added support to the inclusion of nested relation. Reference https://loopback.io/doc/en/lb4/HasMany-relation.html#query-multiple-relations. But it doesn't cover the rest api url to get nested relations. This is what I have…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59
1
vote
0 answers

socket.io in lb3app mounted app in lb4 (loopback)

I have lb3app mounted in lb4 and everything work great except socket.io. The socket.io initiated in the following function in the server.asp app.start = function() { // start the web server return app.listen(function() { …
Omtechguy
  • 3,321
  • 7
  • 37
  • 71
1
vote
1 answer

How to hide open-api spec for one route using loopback 4

Is there a way in Loopback 4 to use the @get() decorator (or any another one), passing the path but not generating the open api spec for this route? By passing a special param / using the @operation or anything? Thank you.
captain hak
  • 742
  • 6
  • 20
1
vote
1 answer

Loopback 4 error after authentication. The key 'authentication.currentUser' is not bound to any value in context application

I've been working with Loopback 4. I'm facing an error recently. After authentication is successful and I try to access the current user from my end point. I get this error 13:31:07 0|index | Unhandled error in POST /posts: 500 Error: The key…
1
vote
1 answer

Loopback4 DefaultTransactionalRepository not working

Looking for help to implement transaction management in loopback4. Using ms-sql database and loopback-connector-mssql as a connector. i am extending repository with DefaultTransactionalRepository. below is the code i am writing inside controller. …
ni-met
  • 23
  • 3
1
vote
1 answer

How to integrate pubnub in loopback4

I am trying to integrate pubnub into my loopback 4 application but I'm not sure where it is supposed to be instantiated or used? Is it supposed to be used in the repository, controller or model? If I try to instantiate it in the repository class, I…
Vikram Khemlani
  • 555
  • 6
  • 17
1
vote
0 answers

LoopBack4 execute a custom group by with find or use existing methods

Hi is use loopback 4 for customs rest this is my collection when i use console.log of this find const resultfilters = await this.reactionsRepository.find(filter) [ Reactions { id: 'c3RyaW5nOnN0cmluZw==', websiteId: 'string', sectionSlug:…
jonathan
  • 114
  • 9
1
vote
1 answer

loopback 4 generate openapi.json on build

I would like to generate an openapi.json file on a loopback 4 api without having to start the server and request the openapi endpoint. I could not find any way to do it in the loopback documentation. Is there any way to generate that file ?
1
vote
1 answer

Loopback 4: Test problems with Sinon and injections

We have trying to do a test with loopback. The test involve to call the google API and we want to mock it with Sinon. The Controller: [...] In the constructor: @inject('services.OAuth2Service') private oauth2Service: OAuth2Service [...] In…
Jota
  • 81
  • 7
1
vote
5 answers

dotenv configure on Loopback 4

How to configure .env file on loopback 4 with dotenv or other packages to access globally from process.env.VAR? I tried following on application.ts but it gives undefined. import * as dotenv from 'dotenv'; ... export class MyApp extends .... { …
Salitha
  • 1,022
  • 1
  • 12
  • 32
1
vote
1 answer

Strongly typed calls to other microservices in LoopBack v4

I'm currently evaluating the suitability of LoopBack for a future microservice-based project. Moreover, I'm new to LoopBack, so please correct me, if a misunderstood the concepts of Loopback. At times, you need an aggregator microservice which calls…
ax1mx2
  • 654
  • 1
  • 11
  • 23
1
vote
0 answers

Connect LoopBack4 to REST API and Swagger

I'm a lb3 user and trying to migrate lb3 projects to lb4. But I got some troubles in doing this: How can I invoke another micro service via swagger/rest connector? I looked into the officeal document and get some links: swagger connector rest…
Miko
  • 77
  • 8
1
vote
2 answers

Why POST method return 500 error for array of values with successfully inserted value?

In loopback 4 There is a strange issue when I POST a single value like : { email: "sit@leoVivamusnibh.net", password: "430975896" } in swagger, there is no issue report but when I post an array of values like: [{ email:…
RSA
  • 1,417
  • 4
  • 22
  • 37
1
vote
1 answer

Loopback-4 Mocking injection

i'm using loopback-4, looking for help to mock the @inject declared at class level. Please find below code. import { repository } from '@loopback/repository'; import { AddressRepository } from './address.repository'; import { Address } from…
ni-met
  • 23
  • 3