working version with /game

This commit is contained in:
Jonathan 2024-03-19 16:37:12 -05:00
parent a3efe2369d
commit ba73d8f3b6
2 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,14 @@ app:get("/", function(self)
} }
end) end)
app:get("/game", function(self)
self.text = say.hello()
self.isPopulated = mapFunc:mapExists(map)
return { render = "game",
}
end)
app:match("/map/render", function(self) app:match("/map/render", function(self)
self.tiles = {} self.tiles = {}
for h = 1, 10 do for h = 1, 10 do

6
views/game.etlua Normal file
View File

@ -0,0 +1,6 @@
<!DOCTYPE HTML>
<script src="/static/htmx.min.js"></script>
<article>
<p style="text-align: center;">Game</p>
<main style="width: 50%;" class="container" id="map" hx-get="/map/render" hx-trigger="every 1s,load">
</article>