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
4
votes
3 answers

Loopback 4 Middleware not registered

I'm following this example here for a simple logging middleware setup. But I can't seem to get it to log my request information. I get the standard response when I hit /ping, but nothing is logged out to the console. I try to register the middleware…
Clement
  • 4,491
  • 4
  • 39
  • 69
4
votes
1 answer

Loopback 4 extract raw body of POST request

For a hashing and verification purpose, raw body (without parsing) of a application/json post request is needed. Does loopback 4 provide any method for that? Request.body is parsed as a json.
Salitha
  • 1,022
  • 1
  • 12
  • 32
4
votes
2 answers

Loopback 4 Command line script: The key 'repositories.CurrencyRepository' is not bound to any value in context

Using Loopback 4, I am trying to execute a simple get request after which I want to store some data in my database. I would like to execute the following code from the command line: import {WebshopApplication} from '../application'; import axios…
xfscrypt
  • 16
  • 5
  • 28
  • 59
4
votes
2 answers

how to use storage components in loopback 4.0?

i am using storage components in loopback 3.0 to accessing the cloud storage's. but i need how do implement in loopback 4.0.The below link to make it sample in 3.0. https://github.com/strongloop/loopback-example-storage
Santhosh
  • 140
  • 2
  • 13
3
votes
1 answer

What is the best practice of creating requestBody in loopback 4?

Currently I am working on Loopback4 and I had this issue. @requestBody({ content: { 'application/json': { schema: getModelSchemaRef(LoginCredentials, { title: 'Login' }) }, } })…
3
votes
2 answers

Loopback 4 authentication Issue with login controller

I am trying to add authentication to my app. There are two models named user and user-credential. The user has one user-credential. The post request to the User is working fine. Password is stored in the user-credential model(hashed) and other…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59
3
votes
1 answer

Loopback 4: Debug SQL Statements

I'm new to Loopback. I have used Sequelize ORM in the past, and I'm used to seeing Sequelize output the SQL statements to the Console. How can I do the same with Loopback 4? I've done extensive searching on the web, and I found a place where they…
Peruz Carlsen
  • 572
  • 2
  • 10
3
votes
5 answers

Loopback 4 deployment in heroku, lb-tsc not found error

I'm trying to deploy a loopback 4 app into heroku. But after publishing it npm-start command not working in heroku console. its throwing sh: 1: lb-tsc not found. package.json is as follows "devDependencies": { "@loopback/build":…
3
votes
2 answers

Extends Entity vs Extends Model in loopback4

What is the Difference between extending Model vs Entity in loopback4? @model export class Todo extends Entity {} @model() export class Todo2 extends Model {}
slim
  • 45
  • 8
3
votes
0 answers

Open socket on dynamic endpoint

I am using loopback to build a route: /users/{id} where users can listen for new information pertaining to their account on their own endpoint. I know I need the socket.io package but I'm not sure what to do with it. How can I open a socket on this…
Vikram Khemlani
  • 555
  • 6
  • 17
3
votes
2 answers

Access express app in LoopBack 4 to add middleware

How can I access the express app instance within a LoopBack 4 application to add a middlware such as helmet or compression via app.use()?
nflaig
  • 673
  • 1
  • 8
  • 15
3
votes
1 answer

Download File with loopback 4

I want to download a file from a loopback 4 based server. My current situation is, that i can access the file with fs.readFileSync, but it's only working for text-files. If i want to download pdf or zip files it's not working. This is what i have so…
MIB
  • 337
  • 2
  • 15
2
votes
1 answer

How to handle success and error API responses with Swift Generics?

I am trying to write a simple function handling authentication POST requests that return JWT tokens. My LoopBack 4 API returns the token as a JSON packet in the following format: { "token": "my.jwt.token" } In case of an error, the following gets…
Chris Kobrzak
  • 1,044
  • 14
  • 20
2
votes
1 answer

Is there a way to render Loopback 4 "/explorer" in collapsed mode by default

I have installed Loopback 4, and mounted my legacy Loopback 3 app into it as part of my migration - all good so far. However my (swagger-ui shaped) explorer renders expanded by default - and there are a LOT of endpoints and services - making it very…
batman567
  • 826
  • 2
  • 12
  • 23
2
votes
0 answers

"ResolutionError: The key 'repositories.xxxxxx.XxxxxRepository' is not bound to any value in context" Error in Production application

Loopback4 application deployed in server and running successfully. After N number of days, its throwing following error: ResolutionError: The key 'repositories.xxxxxx.XxxxxRepository' is not bound to any value in context…
1
2
3
32 33