-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c73e8c3
commit 62e5388
Showing
6 changed files
with
90 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
``` | ||
bun install | ||
bun run dev | ||
``` | ||
|
||
``` | ||
open http://localhost:3000 | ||
``` |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"scripts": { | ||
"dev": "bun run --hot src/index.ts" | ||
}, | ||
"dependencies": { | ||
"@autometrics/autometrics": "file:../../packages/autometrics", | ||
"@autometrics/exporter-prometheus": "^0.7.0-beta4", | ||
"hono": "^3.6.0" | ||
}, | ||
"devDependencies": { | ||
"bun-types": "^0.6.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Context, Hono } from "hono"; | ||
import { logger } from "hono/logger"; | ||
import { autometrics } from "@autometrics/autometrics"; | ||
import { init } from "@autometrics/exporter-prometheus"; | ||
|
||
const app = new Hono(); | ||
|
||
async function rootHandler(ctx: Context) { | ||
return ctx.json({ ok: true, message: "Hello world" }); | ||
} | ||
|
||
app.use("*", logger()); | ||
app.get("/", autometrics(rootHandler)); | ||
|
||
export default app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"jsx": "react-jsx", | ||
"jsxFragmentFactory": "Fragment", | ||
"jsxImportSource": "hono/jsx" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters