Skip to content

Commit

Permalink
Merge pull request #11 from chibat/develop
Browse files Browse the repository at this point in the history
fresh version up and fix
  • Loading branch information
chibat authored Sep 18, 2023
2 parents cba9dea + 5baa009 commit fcfb686
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"imports": {
"$std/": "https://deno.land/std@0.193.0/",
"postgres/": "https://deno.land/x/postgres@v0.17.0/",
"$fresh/": "https://deno.land/x/fresh@1.4.2/",
"$fresh/": "https://deno.land/x/fresh@1.4.3/",
"preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
Expand All @@ -48,4 +48,4 @@
"_fresh"
]
}
}
}
3 changes: 2 additions & 1 deletion dev.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env -S deno run -A --watch=static/,routes/

import dev from "$fresh/dev.ts";
import config from "./fresh.config.ts";
import "$std/dotenv/load.ts";

await dev(import.meta.url, "./main.ts");
await dev(import.meta.url, "./main.ts", config);
10 changes: 10 additions & 0 deletions fresh.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "$fresh/server.ts";
import { initPool } from "~/server/db.ts";
import { env } from "~/server/env.ts";

export default defineConfig({});

if (Deno.args.at(0) !== "build") {
env.init();
initPool();
}
12 changes: 2 additions & 10 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@

import { start } from "$fresh/server.ts";
import manifest from "~/fresh.gen.ts";
import { initPool } from "~/server/db.ts";
import { env } from "~/server/env.ts";
import config from "./fresh.config.ts";

// const render: RenderFunction = (ctx, render) => {
// ctx.lang = "ja";
// render();
// };

env.init();
initPool();
await start(manifest);
await start(manifest, config);
7 changes: 1 addition & 6 deletions routes/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ export default defineRoute(async (req, _ctx) => {
利用モジュール
<ul>
<li>
<a
href="https://github.com/chibat/leaves/blob/main/import_map.json"
target="_blank"
>
import_map.json を参照
</a>
deno.json imports を参照
</li>
<li>
<a href="https://getbootstrap.com/" target="_blank">
Expand Down

0 comments on commit fcfb686

Please sign in to comment.