Skip to content

“Task and gen_tcp” guide might confuse with PORT environment variable #1132

@sonicdoe

Description

@sonicdoe

The Task and gen_tcp guide explains how to read the port from an environment variable but then continues with hardcoding the port. However, towards the end it instructs to start a new server with PORT=4040 mix run --no-halt.

In my opinion, this comes across as confusing as the example above this command explicitly shows the port being hardcoded.

Since this change was deliberately made in #994, I didn’t just want to open a pull request reverting it. Evidently, there’s value in explaining how to specify the PORT environment variable when starting the server. I’m not sure how to best incorporate that into the guide – perhaps an example directly after the System.get_env("PORT") code block?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions