Question

Using Parcel, logs show its trying to run on localhost

I was trying to deploy a simple Node.js app which uses parcel. When deploying I get a successful deployment but the page does not display and I get these errors:

[lit-chat] [2022-03-23 22:08:23] yarn run v1.22.18 [lit-chat] [2022-03-23 22:08:23] $ parcel index.html [lit-chat] [2022-03-23 22:08:50] Server running at http://localhost:8080 [lit-chat] [2022-03-23 22:08:50] Building…

How do I tell the deployment to bind to the given public url? I have tried specifying the --public-url in package.json as well but there was no change.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
August 10, 2022

Hello,

I believe that you should be able to specify the host that your Parcel app binds on using the --host argument.

In your case you could use --host 0.0.0.0 so that the Parcel app would be accessible from the outside world.

Alternatively, you could leave the app on localhost and use Nginx as a reverse proxy. For more information on how to do that you can take a look at step 5 here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#step-5-setting-up-nginx-as-a-reverse-proxy-server

Hope that this helps.

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel