Giter Site home page Giter Site logo

Comments (8)

nhocki avatar nhocki commented on July 23, 2024

@joeyespo FWIW reading the PORT from .env is done on #45 making it -p flag, .env file, default of 5000.

from forego.

ddollar avatar ddollar commented on July 23, 2024

Looks like you're right. Would you be interested in trying to put together a pull request to correct this?

from forego.

ddollar avatar ddollar commented on July 23, 2024

Actually looks like this is covered by #45

from forego.

joeyespo avatar joeyespo commented on July 23, 2024

Nice!

from forego.

joeyespo avatar joeyespo commented on July 23, 2024

Ok, just tested it with the latest build.

#45 did fix the .env problem, but the order is still wrong. Here's the updated order:

  • Foreman's port precedence is -p option, .env file, PORT variable, default of 5000
  • Forego's port precedence is PORT variable, -p option, .env file, default of 5000

Put another way, if PORT just so happens to be in your ENV for another reason, you can't override it using .env or even -p.

from forego.

nhocki avatar nhocki commented on July 23, 2024

@joeyespo I just tested this and the order seems to be:

  1. -p flag
  2. PORT variable in the .env file
  3. Default 5000 port.

Here's what I have:

.env

PORT=6000

Procfile

test: ruby test.rb

test.rb

puts ENV['PORT'].inspect

Running:

1: forego start -p 4000

forego | starting test.1 on port 4000
test.1 | "4000"
  1. forego start
forego | starting test.1 on port 6000
test.1 | "6000"
  1. (After removing the .env file) forego start
forego | starting test.1 on port 5000
test.1 | "5000"

The thing that seems to be missing in #45 is to read directly from the environment.

from forego.

ddollar avatar ddollar commented on July 23, 2024

The precedence that makes the most sense to me is:

  • -p option
  • PORT in .env
  • PORT environment variable
  • 5000

Anyone up for creating a pull request to get forego in line with this?

from forego.

nhocki avatar nhocki commented on July 23, 2024

I can add that, after @sergiobuj PR, only the PORT environment variable is missing.

from forego.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.