How Do You Host A Website Locally?

How do you host a website locally? My stack is MongoDB, Express, and NodeJS. How can I set up a port (like https://localhost:3000), host it locally, and then push it to Heroku? (I may also use cloud nine for dev purposes, but I want to know).

You need to run some kind of a server, eg. serve.

To host your website locally I think you can use the Epress package of npm https://www.npmjs.com/package/express
To push your work on Heroku, you have just to setup it following some guide. I did prefer take this course that explain everythinghs. https://www.udemy.com/the-complete-nodejs-developer-course-2/learn/v4/content

I know express, I just want to know how to get a port!

I know how to use express and heroku, as I said at the beginning. Thanks for trying to help though.

https://expressjs.com/en/starter/hello-world.html

2 Likes

@elisecode247 helps you. You can set every port do you want.

Thanks, helps a lot!