[Solved] 2 HTMLs at the same time on glitch [express]

  1. Is it possible to run 2 HTMLs on glitch at the same time? Maybe this is not a glitch question but a node\express one.
  2. Would be great if someone can demonstrate it with some basic code or link a demo.

What do you mean by having 2 htmls?

That One project can run 2 html on different urls, that i can open at the same time

When you say two urls, do you mean two different page level urls? Like

  • mycoolglitchproject.xyz/page-1.html and
  • mycoolglitchproject.xyz/page-2.html

having different content?

Or do you mean two different domains

  • mycoolglitchprojectaboutcats.xyz and
  • mycoolglitchprojectaboutdogs.xyz

having different content, but being served by the same Glitch project?

Both suit me fine.
But i guess you’re implying that the 2 second option is not doable.

That is correct, You would have to have 2 projects to be able to do the second one.

You literally just need to create a second app get + response, with a new url

app.get(’/html3’, function(request, response) {
response.sendFile(__dirname + ‘/index3.html’);
});

1 Like