Trouble with serving HTMl on localhost
Hi, so I'm building a framework for SSR and I'm struggling with the following:
When I clone my repo and run my example app with
deno run --allow-net example.ts
, and I open up any pages on localhost:8080/page{0-4}
, I see a blank white screen. I have narrowed down the problem to lines 48-75 in the file linked below. Where am I going wrong? I tried a simple console.log
from within the handler closure to no avail. What am I missing here? Link to the file:
https://github.com/angeldollface/mina/blob/main/src/server.tsGitHub
mina/src/server.ts at main Β· angeldollface/mina
A minimal web framework for building reactive, server-side-rendered web applications. :fairy_woman: (W.I.P.) - angeldollface/mina
5 Replies
Hello. I was able to spot the bug and fix it. I also opened a pull request at https://github.com/angeldollface/mina/pull/1
GitHub
Fixed the main bug and made little changes by eroblaze Β· Pull Reque...
The bug was on line 56 in the server.ts file
wrong:
for (let i = 0; i > extendedPages.length; i++){
correct:
for (let i = 0; i < extendedPages.length; i++){
That's a bit of a shame, because I only just saw this just now. I fixed it just now and reduced the amount of code.
(by myself)
Sorry :((
Thank you for trying, though!!!
@eroblaze
@ππΈβπΎπΌπ π»ππππ½πΈβπΌππ΅πΈ :deno_thumbs_up:
I'm working on a little project that does SSR myself. Would love to hear about your framework.
Relatedly (shameless plug) I developed deno-embedder (https://jsr.io/@nfnitloop/deno-embedder) to make it easy to embed any static files necessary for SSR into the Deno binary so they all get bundled with
deno install
or deno compile
. Might be useful for you?I'm a little bit preoccupied at the moment with something else but I will let you know when it is done. Thank you β€οΈ