So far, you’ve been opening your webpage directly from your computer using a
file:// URL, which is a good way to test your code as you write it. But you can’t share a link to a
file:// URL, because the file only exists on your computer.
To share a link to your webpage, you need to host it somewhere so other people can see it.
There are generally two different kinds of hosting available: static file hosting, which is what you’re looking for, and server hosting, which you’ll only need after you start reading the server tutorials.
For now, you can google “static html hosting” or “static file hosting” for a bunch of options. Most static HTML hosts let you upload files, and then they give you the URL of the file you uploaded. You can then send that URL to other people so they can see what you created.
It’s also possible to turn your own computer into a web host, but that requires some more setup, so I personally prefer to use a service that does it for me.
Here are a few I’ve used before:
.htmlfiles that can be used as webpages. Here is a guide on setting up website hosting using Amazon S3; see the Example Walkthroughs at the bottom. Here is a quick start guide on creating a webpage with Amazon Route 53 and Amazon S3.
These are some the services I’ve used before, but there are plenty of other options out there! My advice is to try a few out and see which one you like the best.
If you’re building your own webpage, another thing you might be curious about is customizing your domain name, like
HappyCoding.io in my case.
To get a custom domain name, you have to find a registrar, which is a company that keeps track of who owns which domain name. Then you register your domain name and point it at your host. Then when people visit your custom domain, they’ll see your webpage!
I personally use Namecheap, but you can google “domain registrars” for a bunch of options.