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

Support multiple versions of an API simultaneously (via path)

Question: we've just started to explore loopback, one of our requirements is to host multiple versions of an API simultaneously (e.g. foo.com/api/v1/products, foo.com/api/v2/products). Is this straightforward to do? Any example(s) someone could…
denishaskin
  • 3,305
  • 3
  • 24
  • 33
1
vote
0 answers

Howto share Typescript libraries between Loopback (NodeJS) and Angular apps in monorepo

I have a monorepo (using nx as manager), which contains five Angular apps, and one Loopback 4 (NodeJS, TS) app. I also have several Angular libraries which are shared as expected, and using @angular-architects/ddd to architect the types of…
batman567
  • 826
  • 2
  • 12
  • 23
1
vote
1 answer

Remove nested relations from API explorer (swagger)

I have Application model with following relation: @belongsTo(() => Ido) idoId: string; export interface ApplicationRelations { ido?: IdoWithRelations; } export type ApplicationWithRelations = Application & ApplicationRelations; Application…
invisiblecat
  • 125
  • 1
  • 10
1
vote
0 answers

Installing an npm package globally from a forked repo

I have been trying to install loopback 4 cli from a forked repository. But it's always failing. I have tried installing using the following: npm install -g https://github.com:OnTheThirdDay/loopback-next.git It fails with the following error: npm…
aaqilniz
  • 66
  • 2
  • 5
1
vote
1 answer

Loopback4 execute sql with params / ER_BAD_FIELD_ERROR: Unknown column 'reactionType' in 'field list'

I want to increase the value of the 'reactionType' column in my table by 1 according to the 'reactionType' value I get from the api. reactionType is a variable endpoint. e.g /like /dislike ... If a like is received, I will increase the value of the…
Enes
  • 11
  • 2
1
vote
1 answer

How can i log request.body in middleware sequence loopback 4?

Am new to loopback, am trying to console request.body in loopback 4 to view the incoming data, but if i print it it prints as undefined, i know i need to use body parser package here, but i can't able to figure it how to use it with LB4? Any help…
Kannan T
  • 1,639
  • 5
  • 18
  • 29
1
vote
1 answer

How do I get the user IP address from the incoming request in loopback 4?

Am new to loopback 4, I want to get the user IP address, their domain details, user agent and the url they are trying to access so on so i wrote a sequence, i have accessed the request context but couldn't get the exact key to find out the details…
Kannan T
  • 1,639
  • 5
  • 18
  • 29
1
vote
0 answers

Is there a way to require loopback4 as a node module?

I've been working for a long time with Loopback3, but it has reached EOL, so now I'm starting to migrate to LB4, the thing is, I've been digging around and haven't found a specific way to require LB4 as a node module, as it is possible with LB3…
1
vote
1 answer

lb4 app throws "Error: ENOENT: no such file or directory"

I am trying to create a loopback4 application following the official loopback documentation nvm version: 0.39.1 node version: v17.4.0 npm version: 8.3.1 I installed loopback4 using npm i -g @loopback/cli I get the following error when creating a…
Napstablook
  • 594
  • 1
  • 6
  • 24
1
vote
0 answers

Loopback4: Access target model with nested inclusion in HasManyTrough

I am trying to access a target model and its related models in a hasManyThrough setup in Loopback 4. For example in the documentation: https://loopback.io/doc/en/lb4/HasManyThrough-relation.html how do I get all appointments of a specific doctor…
xfscrypt
  • 16
  • 5
  • 28
  • 59
1
vote
1 answer

How to use typescript path aliases in Loopback-4

I would like to import modules using Typescript path aliases. Now I am importing as follows. user.controller.ts import { resourcePermissions } from '../../utils/resource-permissions'; import { allRoleAuthDetails } from…
Prince Francis
  • 2,995
  • 1
  • 14
  • 22
1
vote
1 answer

Loopback 4 how to override the built-un User model

I'm a beginner on loopback 4. I'm trying to secure my REST API with @loopback/authentication-jwt. I would like to add some columns on User built-in model but i don't know why... I have not found any documentation about that. Can you help me please…
1
vote
2 answers

How can I access a repository globally in loopback 4?

I used loopback 4 to bootstrap my API application and developed some parts of it. Now I'm trying to access repositories outside the controllers and tried everything I could but didn't help. None of my searches did too. For example I have a…
1
vote
0 answers

Error connecting to MongoDB with Loopback 4

I'm having trouble connecting to MongoDB from Loopback 4. We have lots of services that connect to MongoDB from Loopback 3, but this is the first attempt at using Loopback 4. The error I'm getting is: (node:1) [MONGODB DRIVER] Warning: Top-level…
piccy
  • 336
  • 2
  • 12
1
vote
0 answers

Loopback 4 caching with redis

How do you cache database response using Redis in loopback 4, similar to Redis cache mixin for loopback 3?
Miguta-K
  • 11
  • 1