Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 16:43
    uniconstructor edited #4126
  • Jan 31 16:41
    uniconstructor edited #4126
  • Jan 31 16:41
    uniconstructor opened #4126
  • Jan 31 03:44
    dzungh0ang closed #4123
  • Jan 30 00:25
    techaks closed #4125
  • Jan 30 00:02
    techaks edited #4125
  • Jan 30 00:01
    techaks opened #4125
  • Jan 29 23:33
    jkpulido opened #4124
  • Jan 29 13:32
    nabdelgadir closed #4114
  • Jan 29 09:17

    bajtos on add-node10

    (compare)

  • Jan 29 07:13
    dzungh0ang opened #4123
  • Jan 29 04:25
    dhmlau closed #3881
  • Jan 28 13:14
    bajtos edited #4119
  • Jan 28 12:47
    bajtos labeled #4121
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos assigned #4118
  • Jan 25 19:50
    dhmlau closed #3906
  • Jan 25 19:13
    mschnee synchronize #4119
Matthew Miller
@mamiller93
Also what’s the benefit of calling other API through services instead of simply calling the darn thing directly from import (etc)?
Leryll Louie Piol
@louiepiol
I end up using firebase sdk instead of community connector @dhmlau
Can I still create service without datasource generator won't me?
田宝勇
@tianbaoyong_gitlab
How to connect and use qiniu storage in LoopBack project?
Who can help me?
sunilsmith
@sunilsmith
I have question related to hasMany relation and cascading ORM level in loopback4, i have posted the complete scenario on stackoverflow(https://stackoverflow.com/questions/57391303/using-hasmany-relation-and-cascading-orm-level-in-loopback4), can someone help us with a solution
Diana Lau
@dhmlau
@sunilsmith , i've responded in your stackoverflow post.
Diana Lau
@dhmlau
@tianbaoyong_gitlab , I don't have any knowledge about qiniu, but i just found this: https://www.npmjs.com/package/loopback-component-storage-qiniu. Were you able to use this community module?
田宝勇
@tianbaoyong_gitlab
@dhmlau thanks I try it today!
Diana Lau
@dhmlau
Hi everyone, we're pleased to share that LoopBack won the API World’s 2019 Best in API Middleware category! :tada:
For our announcement blog post, please see https://strongloop.com/strongblog/loopback-2019-api-award-api-middleware/
Pete Hurl
@MoribundMedium

Hello! I'm very new to LoopBack and I have a question if anyone has the time. I'm trying to use an external API with my application, similar to this demonstration (https://loopback.io/doc/en/lb4/Calling-other-APIs-and-web-services.html), and I'm not sure how to handle the return values. The objects returned from the API have more properties than the model in my application and I'd like to strip those out. However, I'm not clear what the recommended method is. Perhaps using a DTO to map and remove the unneeded properties? But there's no documentation for building DTOs even though they're mentioned in the tutorial. Or should the model be handling this already and I configured it wrong?

By the way, congrats on the API World award!

Pete Hurl
@MoribundMedium
Hm... Well, I got it to work by mapping the return values to new objects. Not sure if that's how it's supposed to be done, but it works. It just feels a little weird using a return type of any[] in the service, since using a type doesn't seem to do much. Controller mapping code, in short:
@get('')
async getExternalApiObjects(): Promise<ExternalApiObject[]> {
  return await this.externalApiService.get().then(function(objects) {
    return objects.map(obj => new ExternalApiObject(obj));
  });
}
Darko Damljanović
@darko.damljanovic1_gitlab
Hello. Is there any good way of handling and merging multiple entities to serve single REST endpoint? I have a scenario where I need to get data from a database and merge them as one organized response object as a combination of multiple entities?
hgeldenhuys
@hgeldenhuys
How do you change the URL and Port for a LoopBack App's Swagger and Rest API?
On LB4 app using cli
Jam Risser
@codejamninja
It should follow this schema
hgeldenhuys
@hgeldenhuys
Thanks @codejamninja That's the Swagger bit, and the API server, aka the URI Swagger will call?
In otherwords when you start the app:
Server is running at http://[::1]:3000 Try http://[::1]:3000/ping
Jam Risser
@codejamninja
Is that what you are looking for?
hgeldenhuys
@hgeldenhuys
Yep, that's the one
Jam Risser
@codejamninja
Oh, so you want to change it
hgeldenhuys
@hgeldenhuys
That's right
Jam Risser
@codejamninja
Change the following
    this.bind(RestExplorerBindings.CONFIG).to({
      path: '/explorer'
    });
It won't change the port though, because it runs on the same app
hgeldenhuys
@hgeldenhuys
Oh sorry man, the port and host is what I'm trying to change. Ie the HTTP Server settings, not so much the path
Jam Risser
@codejamninja
I guess you could have an nginx server with rewrite rules that does a proxy_pass upstream into the explorer path, but I'm not sure why you would need to go to all that trouble.
You could do something like the following, and instead of proxying into example.com, you would proxy to http://localhost:3000/explorer
It's not really a loopback thing. More of a server level thing.
hgeldenhuys
@hgeldenhuys
Oh I see, so the intention is to only run a single Loopback server locally at any given time then?
Unless you run them on Dockers. I'm trying to server on http://mycomputer.local:3001
Jam Risser
@codejamninja
Another option would be to export your swagger config and run a separate swagger server.
hgeldenhuys
@hgeldenhuys
That's the Swagger part, but the Restserver API is the real issue
Jam Risser
@codejamninja
Regardless, what you want to do requires running two servers. 1 for loopback and 1 to serve the swagger.
hgeldenhuys
@hgeldenhuys
Not quite, I'm trying to run 2 seperate Loopback Apps
Jam Risser
@codejamninja
Could you explain your use case, maybe that would help.
hgeldenhuys
@hgeldenhuys
1- I have 2 loopback apps, the second one wants to serve on the same port, so that needs to change
2- I need to conveniently access it from my Windows VM but LB is on my Mac
That's about it
Jam Risser
@codejamninja
Oh, so you just want to run your 2 loopback apps on different ports.
hgeldenhuys
@hgeldenhuys
That's right
Once I get the port config I could probably figure out the public IP or host config
It seems the Documentation still refers to a previous class API on loopback.io so I'm wildly guessing and digging around in the code
Jam Risser
@codejamninja
You need to override the contrustor
    super({
      ...options,
      rest: {
        ...options.rest,
        host: '0.0.0.0',
        port: 9999
      }
    });
Another option would be to package both servers into separate docker containers, and map the ports
hgeldenhuys
@hgeldenhuys
You're a champ my friend
Thanks a million @codejamninja