Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spike] Ideal host setting for scaffolded application #2350

Closed
emonddr opened this issue Feb 7, 2019 · 2 comments
Closed

[Spike] Ideal host setting for scaffolded application #2350

emonddr opened this issue Feb 7, 2019 · 2 comments
Labels
REST Issues related to @loopback/rest package and REST transport in general spike stale

Comments

@emonddr
Copy link
Contributor

emonddr commented Feb 7, 2019

Description

To successfully run an lb4 app inside a docker container, it was necessary to change the host to '0.0.0.0' in order to access the REST server running in that docker container from a browser.

Related to : #1606

See : https://loopback.io/doc/en/lb4/deploying_to_ibm_cloud_kubernetes.html

I double-checked with @BINIAM , to see if he would need to do the same. He did. And suggested a change in the generated index.js of a scaffolded application:

See : #1606 (comment)

@bajtos suggested that we refresh our understanding historical discussions of 'localhost' vs '0.0.0.0' and why 'localhost' was chosen:

See : #1606 (comment)

There may be several different approaches to take since there are multiple places to specify server host values.

In config.rest options, or config.rest.openApiSpec options, etc

 const config = {
    rest: {
      port: +process.env.PORT || 3000,
      host: process.env.HOST || 'localhost',
      openApiSpec: {
        // useful when used with OASGraph to locate your application
        setServersFromRequest: true,
      },
    },
  };

Investigate each possibility, and outline their pros and cons.

@emonddr emonddr added spike REST Issues related to @loopback/rest package and REST transport in general labels Feb 7, 2019
@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Feb 2, 2020
@stale
Copy link

stale bot commented Mar 3, 2020

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REST Issues related to @loopback/rest package and REST transport in general spike stale
Projects
None yet
Development

No branches or pull requests

1 participant