Skip to content

Commit

Permalink
Merge branch 'main' of github.com:notangelmario/flashserve
Browse files Browse the repository at this point in the history
  • Loading branch information
notangelmario committed Sep 14, 2022
2 parents 7ebdd19 + 45e597a commit a342b19
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
1 change: 0 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"importMap": "./import_map.json",
"tasks": {
"test": "deno test --allow-read --allow-net"
}
Expand Down
8 changes: 0 additions & 8 deletions import_map.json

This file was deleted.

14 changes: 14 additions & 0 deletions src/deps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export {
join
} from "https://deno.land/std@0.154.0/path/mod.ts";
export {
serve
} from "https://deno.land/std@0.154.0/http/server.ts";
export {
assert,
assertStringIncludes
} from "https://deno.land/std@0.154.0/testing/asserts.ts";
export {
render as gfmRender,
CSS as gfmCSS
} from "https://deno.land/x/gfm@0.1.24/mod.ts";
10 changes: 5 additions & 5 deletions src/mod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from "path";
import { serve as httpServe } from "server";
import { CSS, render } from "gfm";
import { join } from "./deps.ts";
import { serve as httpServe } from "./deps.ts";
import { gfmCSS, gfmRender } from "./deps.ts";
import { splitPath } from "./utils.ts";
import { Options } from "./types.ts";

Expand All @@ -23,7 +23,7 @@ const handlePages = async (url: URL, directory: string): Promise<Response> => {
return new Response("Not found", { status: 404 })
}

const body = render(fileContent)
const body = gfmRender(fileContent)

const html = `
<!DOCTYPE html>
Expand All @@ -43,7 +43,7 @@ const handlePages = async (url: URL, directory: string): Promise<Response> => {
margin: 2rem auto;
padding: 0 1rem;
}
${CSS}
${gfmCSS}
</style>
</head>
<body>
Expand Down

0 comments on commit a342b19

Please sign in to comment.