Skip to content

Set Custom Port for Dev Env #66

Open

Description

@Maddy-dev03

I'm using an online ide at the moment and every time I start the app it runs on localhost. is there any way I could use it without hosting locally.

Activity

  1. jaruba commented on Nov 9, 2020

    @jaruba
    Owner

    It's usually the online ide that automatically exposes apps on a subdomain, but not all do.. In lack of that the options can be limited in your scenario.. are you sure that they are exposing the app ports externally? because if it doesn't then i can't think of ways you can do this.. free reverse proxy services will crack under the pressure of media streaming..

  2. Maddy-dev03 commented on Nov 9, 2020

    @Maddy-dev03
    Author

    I am pretty sure they are coz generally I use express and in that I add a simple app.listen with process.env variables like .id and .port and it works fine.
    In this case you have used get-port instead and I cant figure out an alternative to the above process.

  3. jaruba commented on Nov 9, 2020

    @jaruba
    Owner

    You can set a port by using process.env.PWFRONTPORT, see here:

    port = process.env.PWFRONTPORT

  4. Maddy-dev03 commented on Nov 10, 2020

    @Maddy-dev03
    Author

    I did set the export value of PWFRONTPORT=3000 and now its showing that port 3000 is already being used.

  5. jaruba commented on Nov 10, 2020

    @jaruba
    Owner

    But 3000 is already the default port:

    webServerPort: 3000,

    Does it need to be 3000? Try not setting process.env.PWFRONTPORT and changing the default port from the ./server/utils/config.js to something else instead of 3000. You will probably need to initiate a new project for this on the online IDE, as the config may already be saved to another file in the current project you are working in.

  6. jaruba commented on Nov 10, 2020

    @jaruba
    Owner

    Btw, i can't be sure of this, but you should probably try installing the headless branch:
    https://github.com/jaruba/PowderWeb/tree/headless

    It should work better then the master branch for deploying on online servers.

  7. jaruba commented on Nov 10, 2020

    @jaruba
    Owner

    The correct way of using the headless branch (at least locally) would be:

    git clone -b headless https://www.github.com/jaruba/PowderWeb.git
    cd PowderWeb
    npm install
    cd public
    bower install
    cd ..
    npm run build-front
    npm run start-headless
    

    And port 3000 (currently the default port) would need to be exposed on the server.

  8. changed the title [-]START COMMAND[/-] [+]Set Custom Port for Dev Env[/+] on Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions