Skip to content

Instantly share code, notes, and snippets.

@nakasyou
Created May 4, 2023 12:22
Show Gist options
  • Save nakasyou/36d09402968ba6e45d358377bd389884 to your computer and use it in GitHub Desktop.
Save nakasyou/36d09402968ba6e45d358377bd389884 to your computer and use it in GitHub Desktop.
Hono server
import { Hono } from "https://deno.land/x/hono/mod.ts"
import { serveStatic } from "https://deno.land/x/[email protected]/middleware.ts";
import { serve } from 'https://deno.land/std/http/server.ts'
const port = Deno.args.length >= 1 ? Deno.args[0] : 8080
const app = new Hono()
app.use("/*",serveStatic())
serve(app.fetch,{
port,
})
@nakasyou
Copy link
Author

nakasyou commented May 4, 2023

deno install --allow-read --allow-net --force --name honodeno https://gist.githubusercontent.com/nakasyou/36d09402968ba6e45d358377bd389884/raw/3ac0489d75c6178c39eeca20e2d66a4b7ca04774/server.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment