diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-04-29 13:27:12 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-04-29 13:27:12 +0900 |
| commit | fa371513a4374edc49803b6d60c41aff902041e7 (patch) | |
| tree | 60184fa14ca5403e2032a353499170fb7c06b5c6 /vhosts/blog/nuldoc-src/commands | |
| parent | 0281e88dab3c4f156f8f3f1170cc6bde61710bde (diff) | |
| download | nsfisis.dev-fa371513a4374edc49803b6d60c41aff902041e7.tar.gz nsfisis.dev-fa371513a4374edc49803b6d60c41aff902041e7.tar.zst nsfisis.dev-fa371513a4374edc49803b6d60c41aff902041e7.zip | |
chore(blog/nuldoc): update deps
Diffstat (limited to 'vhosts/blog/nuldoc-src/commands')
| -rw-r--r-- | vhosts/blog/nuldoc-src/commands/serve.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/vhosts/blog/nuldoc-src/commands/serve.ts b/vhosts/blog/nuldoc-src/commands/serve.ts index aa5221df..5fe8a6f9 100644 --- a/vhosts/blog/nuldoc-src/commands/serve.ts +++ b/vhosts/blog/nuldoc-src/commands/serve.ts @@ -1,12 +1,11 @@ import { serveDir } from "std/http/file_server.ts"; -import { Status, STATUS_TEXT } from "std/http/http_status.ts"; -import { serve } from "std/http/server.ts"; +import { STATUS_CODE, STATUS_TEXT } from "std/http/mod.ts"; import { join } from "std/path/mod.ts"; import { Config } from "../config.ts"; export function runServeCommand(config: Config) { const rootDir = join(Deno.cwd(), config.locations.destDir); - serve(async (req) => { + Deno.serve(async (req) => { const pathname = new URL(req.url).pathname; if (!pathname.endsWith("css") && !pathname.endsWith("svg")) { const command = new Deno.Command( @@ -22,14 +21,14 @@ export function runServeCommand(config: Config) { fsRoot: rootDir, showIndex: true, }); - if (res.status !== Status.NotFound) { + if (res.status !== STATUS_CODE.NotFound) { return res; } const notFoundHtml = await Deno.readTextFile(join(rootDir, "404.html")); return new Response(notFoundHtml, { - status: Status.NotFound, - statusText: STATUS_TEXT[Status.NotFound], + status: STATUS_CODE.NotFound, + statusText: STATUS_TEXT[STATUS_CODE.NotFound], headers: { "content-type": "text/html", }, |
