aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.ts10
-rw-r--r--src/public/index.html19
-rw-r--r--src/public/test.html13
3 files changed, 28 insertions, 14 deletions
diff --git a/src/main.ts b/src/main.ts
index 828ec24..3eded62 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -6,19 +6,19 @@ import * as groups from "./groups/index.ts";
import DBController from "./db/DBController.ts";
// Ugly solution
-(async () => await (new DBController()).init())();
+(async () => await new DBController().init())();
const port = parseInt(Deno.env.get("PORT") || "8080");
const app = new Application();
app.renderer = {
- render<T>(name: string, data: T): Promise<Deno.Reader> {
- return renderFile(name, data);
- },
+ render<T>(name: string, data: T): Promise<Deno.Reader> {
+ return renderFile(name, data);
+ },
};
app.static("/", "./src/public/"); // Manage static files
-app.get("/", async (c: Context) => await c.render("./src/public/index.html")); // Render index on /
+app.get("/", async (c: Context) => await c.render("./src/public/test.html", { name: "test" })); // Render index on /
// Load groups dynamically
// deno-lint-ignore ban-ts-comment
diff --git a/src/public/index.html b/src/public/index.html
index 25eaea5..99a87cd 100644
--- a/src/public/index.html
+++ b/src/public/index.html
@@ -1,10 +1,11 @@
<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>Title</title>
-</head>
-<body>
- <h1>Home :)</h1>
-</body>
-</html> \ No newline at end of file
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width" />
+ <title>Index</title>
+ </head>
+ <body>
+ body
+ </body>
+</html>
diff --git a/src/public/test.html b/src/public/test.html
new file mode 100644
index 0000000..b188db3
--- /dev/null
+++ b/src/public/test.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Title</title>
+ </head>
+ <body>
+ <h1>Home :)</h1>
+ <% if (name) { %>
+ <h1>hello, <%= name %>!</h1>
+ <% } %>
+ </body>
+</html>