diff options
author | Marvin Borner | 2020-07-18 15:07:19 +0200 |
---|---|---|
committer | Marvin Borner | 2020-07-18 15:07:19 +0200 |
commit | 476715384f4a5d0b7d887961b43b7aa271c08495 (patch) | |
tree | 32501aca89192e84a57c5f10eef505226205e75e | |
parent | a9615553221706967527ee51e5387b16cf12cd12 (diff) |
WHO TH INDENTS WITH 2 SPACES YOU FRIGGIN DENOSAURS
-rw-r--r-- | .editorconfig | 8 | ||||
-rw-r--r-- | .github/workflows/test.yaml | 4 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rwxr-xr-x | run | 2 | ||||
-rw-r--r-- | src/main.ts | 10 | ||||
-rw-r--r-- | src/public/index.html | 19 | ||||
-rw-r--r-- | src/public/test.html | 13 |
8 files changed, 47 insertions, 24 deletions
diff --git a/.editorconfig b/.editorconfig index fe1ae2d..d241554 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,4 +4,10 @@ root = true end_of_line = lf insert_final_newline = true indent_style = space -indent_size = 2 +indent_size = 4 + +[*.html] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 359a549..29da35d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,8 +21,8 @@ jobs: uses: denolib/setup-deno@master with: deno-version: ${{ matrix.deno_version }} - - name: Format check Deno Module - run: deno fmt --check + # - name: Format check Deno Module + # run: deno fmt --check - name: Lint Deno Module run: deno lint --unstable - name: Test Deno Module @@ -1,4 +1,5 @@ .idea/ .vscode/* !.vscode/launch.json -.env
\ No newline at end of file +.env +.floo* @@ -1,9 +1,11 @@ # Kloud? Doubt! -## Prerequisite -- [Deno](https://deno.land/) -- MySQL/MariaDB +## Prerequisites + +- [Deno](https://deno.land/) +- MySQL/MariaDB ## Run -- Create .env file like [.example.env](/.example.env) in project root -- Execute [run](/run): `./run`
\ No newline at end of file + +- Create .env file like [.example.env](/.example.env) in project root +- Execute [run](/run): `./run` @@ -1,3 +1,3 @@ #!/usr/bin/env sh -deno run -q --allow-net --allow-env --allow-read src/main.ts +deno run -q --allow-net --allow-env --allow-read --unstable src/main.ts 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> |