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
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
Jam Risser
@codejamninja
@hgeldenhuys thanks. Glad I could help. I was confused by your question at first.
hgeldenhuys
@hgeldenhuys
Sorry, I probably could have phrased it a bit better. Probably juggling too many new ideas atm
Jam Risser
@codejamninja
@hgeldenhuys no prob
Diana Lau
@dhmlau
@MoribundMedium . Thanks. :)
Please take a look at my example: https://github.com/dhmlau/loopback4-github-analytics/blob/master/src/services/query.service.ts. If what's returned have more properties than you want in the application, you can create an interface with the exact properties you want.
Darko Damljanović
@darko.damljanovic1_gitlab
How to ad authorization bearer in openapi from controllers. Is there a way to move openapi definitions to a separate file?
Sulejman Sarajlija
@Sulejman
Hey guys, does anyone know how to update summaries for custom remote methods (REST API endpoints) so that they appear in explorer and in swagger file when exported?
Nico Flaig
@nflaig
@dhmlau Hi, I noticed that all your node modules publish their src files is there a particular reason for this? I thought the build .js files and .d.ts files are all that needs to be published
Darko Damljanović
@darko.damljanovic1_gitlab
How to enable CORS? My loopback 4 application constantly blocks request from the outside source, even though, documentation says that CORS is enabled?
Abel
@0bot
Hi guys, is there any example to use Loopbackjs with i18n ?
Matthew Miller
@mamiller93
@darko.damljanovic1_gitlab did you figure out the authorization bearer in openapi question?
Eduardo Mazzucchelli
@emazzu
hi, how are you ?
I m going to use the loopback 3.3, I can do a docuement preview with loopback-component-storage ??
Jyoti Chhetri
@jyoti-openair

Hi, please anyone can suggest, I need to automatically fill a field by the loggedin userId.

ex; I have a model account which has field createdBy. I dont want to send createdBy from the front end but, want to set it as the loggedin user Id whenever new account is added. Is there a way to do this ?

Matthew Miller
@mamiller93
@jyoti-openair I would think you’d need to create a helper function that returns the logged in user and when you’re saving your instance of a model (through your repo), fill in that logged in user?
unless there’s another magical way in loopback that I don’t know of (not terribly familiar with it all yet)
or maybe there’s a binding that can give you the current user?!
Jyoti Chhetri
@jyoti-openair

@mamiller93 ok, I figured out using the after save hook, and updating the createdBy with the current user.

The problem now is ctx.options as well as ctx.hookState is empty. This is where I could access the logged in user

Matthew Miller
@mamiller93
@jyoti-openair you couldn’t get the current user at save but only after save?
Jyoti Chhetri
@jyoti-openair

@mamiller93 no,

Model.observe('after save', function(ctx, next) {
//could not get it here ctx.options and ctx.hookState is empty

});

Sebastian Torres
@SebTorres
Hello. Has anyone here implemented Auth0 in a LB4 app? I am kind of new ad having trouble with this
Darko Damljanović
@darko.damljanovic1_gitlab
@mamiller93 unfortortunatelly no. I had no luck how to add input field in swagger. I did however manage to visually represent that end point is secured (lock icon).
@mamiller93 I have found what was wrong with the CORS. It was not Loopback at all.