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

Set Custom Port for Dev Env #66

Open
Maddy-dev03 opened this issue Nov 9, 2020 · 7 comments
Open

Set Custom Port for Dev Env #66

Maddy-dev03 opened this issue Nov 9, 2020 · 7 comments

Comments

@Maddy-dev03
Copy link

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.

@jaruba
Copy link
Owner

jaruba commented Nov 9, 2020

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..

@Maddy-dev03
Copy link
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.

@jaruba
Copy link
Owner

jaruba commented Nov 9, 2020

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

port = process.env.PWFRONTPORT

@Maddy-dev03
Copy link
Author

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

@jaruba
Copy link
Owner

jaruba commented Nov 10, 2020

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.

@jaruba
Copy link
Owner

jaruba commented Nov 10, 2020

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.

@jaruba
Copy link
Owner

jaruba commented Nov 10, 2020

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.

@jaruba jaruba changed the title START COMMAND Set Custom Port for Dev Env Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants