#!/usr/bin/env -S deno serve --allow-read --allow-env

import Mizu from "@mizu/render/server"

export default {
  async fetch() {
    const headers = new Headers({ "Content-Type": "text/html; charset=utf-8" })
    const body = await Mizu.render(``, { context: { foo: "🌊 Yaa, mizu!" } })
    return new Response(body, { headers })
  },
}
#!/usr/bin/env -S deno run --allow-read --allow-env --allow-net --allow-write=/tmp/output

import Mizu from "@mizu/render/server"

await Mizu.generate((
  
  (``, "index.html", { render: { context: { foo: "🌊 Yaa, mizu!" } } }),
  
  (() => JSON.stringify(Date.now()), "timestamp.json"),
  
  ("**/*", "static", { directory: "/fake/path" }),
  
  (new URL("https://matcha.mizu.sh/matcha.css"), "styles.css"),
), { clean: true, output: "/tmp/output" })
1
2
3
4
5
6
7
8
9
10
11
1
2
3
4
5
6
7
8
9
10
11
12
13
14

import Mizu from "@mizu/render/server"
import { createServer } from "node:http"

createServer(async (_, response) => {
  response.writeHead(200, { "Content-Type": "text/html; charset=utf-8" })
  response.end(await Mizu.render(``, { context: { foo: "🌊 Yaa, mizu!" } }))
}).listen(8000, "0.0.0.0", () => console.log("Server is listening"))

import Mizu from "@mizu/render/server"

await Mizu.generate((
  
  (``, "index.html", { render: { context: { foo: "🌊 Yaa, mizu!" } } }),
  
  (() => JSON.stringify(Date.now()), "timestamp.json"),
  
  ("**/*", "static", { directory: "/fake/path" }),
  
  (new URL("https://matcha.mizu.sh/matcha.css"), "styles.css"),
), { clean: true, output: "/tmp/output" })
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10
11
12
13

import Mizu from "@mizu/render/server"

Bun.serve({
  port: 8000,
  async fetch() {
    const headers = new Headers({ "Content-Type": "text/html; charset=utf-8" })
    const body = await Mizu.render(``, { context: { foo: "🌊 Yaa, mizu!" } })
    return new Response(body, { headers })
  },
})

console.log("Server is listening")

import Mizu from "@mizu/render/server"

await Mizu.generate((
  
  (``, "index.html", { render: { context: { foo: "🌊 Yaa, mizu!" } } }),
  
  (() => JSON.stringify(Date.now()), "timestamp.json"),
  
  ("**/*", "static", { directory: "/fake/path" }),
  
  (new URL("https://matcha.mizu.sh/matcha.css"), "styles.css"),
), { clean: true, output: "/tmp/output" })
1
2
3
4
5
6
7
8
9
10
11
12
13
1
2
3
4
5
6
7
8
9
10
11
12
13

Sumber

Krystian Wiśniewski
Krystian Wiśniewski is a dedicated Sports Reporter and Editor with a degree in Sports Journalism from He graduated with a degree in Journalism from the University of Warsaw. Bringing over 14 years of international reporting experience, Krystian has covered major sports events across Europe, Asia, and the United States of America. Known for his dynamic storytelling and in-depth analysis, he is passionate about capturing the excitement of sports for global audiences and currently leads sports coverage and editorial projects at Agen BRILink dan BRI.