feat: implement basic server
This demo can: - Serve a webpage - Serve static assets - Asynchronously fetch html
This commit is contained in:
0
templates/fragment/.gitkeep
Normal file
0
templates/fragment/.gitkeep
Normal file
8
templates/fragment/table.html
Normal file
8
templates/fragment/table.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<thead>
|
||||
<tr><th>foo</th><th>bar</th><th>baz</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in table %}
|
||||
<tr><td>{{ row.foo }}</td><td>{{ row.bar }}</td><td>{{ row.baz }}</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
28
templates/layout.html
Normal file
28
templates/layout.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<link rel="stylesheet" href="/static/css/style.css" />
|
||||
|
||||
<script src="/static/js/htmx.min.js"></script>
|
||||
<script src="/static/js/script.js"></script>
|
||||
|
||||
<title>Hello htmx!</title>
|
||||
</head>
|
||||
<body>
|
||||
<hgroup>
|
||||
<h1>Hello htmx!</h1>
|
||||
<p>A new old way to build web applications</p>
|
||||
</hgroup>
|
||||
|
||||
<table>
|
||||
<tr><td>
|
||||
<button hx-get="/table" hx-target="table" hx-push-url="true">
|
||||
Load data
|
||||
</button>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
0
templates/partial/.gitkeep
Normal file
0
templates/partial/.gitkeep
Normal file
Reference in New Issue
Block a user