0

Using GitHub and need to send users to an html page but when users click on link, no content is shown. This is my code

The link is -> My GitHub link + hostName + ":8080/page.html" The hostName is : var hostName = require('os').hostname();

Any idea why this doesn't work?

  • is the host publicly visible on the *internet*? – Bravo Jun 08 '22 at 00:58
  • @Bravo Yes, I set it to public and still the page shows up blank – Niki 81519 Jun 08 '22 at 01:29
  • *"I set it to public"* sounds like you don't know what I mean - you know, DNS and all that – Bravo Jun 08 '22 at 01:49
  • @Bravo I'm not sure if this is what you mean but I did try port listen and it didn't work. – Niki 81519 Jun 08 '22 at 02:03
  • 1
    no idea what you're talking about in that comment ... you are using a link to a server ... `My GitHub link + hostName + ":8080/page.html` - now, I have NO idea if that results in a **valid** url - since I have no idea what "My Github link" is, nor "hostName" ... seems an odd thing to concatenate together though ... and there's no evidence that there's even a valid "protocol" portion for that URL (i.e. `http://` or `https://`) - YOU can see what the URL result is, we can't – Bravo Jun 08 '22 at 02:08
  • @Bravo Yes my bad. So the link constant goes something like this: const link = "https://username-code50-80305592-examplecode.github.dev/"+hostName+":3000/page.html"; I know what I did definitely wasn't the right way to make the host public but I tried app.listen(3000). And on Github itself, the option to either keep the server private or public didn't make a difference. Is there any other way to make the host public on the server? – Niki 81519 Jun 08 '22 at 02:48
  • `https://username-code50-80305592-pjgqg5wrg29p79.github.dev/%22+hostName+%22:3000/page.html` doesn't look like a valid URL .... `https://username-code50-80305592-pjgqg5wrg29p79.github.dev/page.html` does – Bravo Jun 08 '22 at 02:51
  • @Bravo I used that originally and had the same problem. – Niki 81519 Jun 08 '22 at 03:03
  • did you - well, not sure what you did wrong – Bravo Jun 08 '22 at 03:09

0 Answers0