-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from wtfdivyansh/main
fix imports
- Loading branch information
Showing
7 changed files
with
42 additions
and
55 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
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
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
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
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 |
---|---|---|
@@ -1,23 +1,21 @@ | ||
import { Hono } from "hono"; | ||
import { auth } from "@repo/auth"; | ||
|
||
const app = new Hono(); | ||
const app = new Hono() | ||
.get("/", async (c) => { | ||
const session = await auth.api.getSession({ headers: c.req.raw.headers }); | ||
|
||
app.get("/", async (c) => { | ||
const session = await auth.api.getSession({ headers: c.req.raw.headers }); | ||
if (!session) return c.json({ message: "no session found" }, 401); | ||
|
||
if (!session) return c.json({ message: "no session found" }, 401); | ||
|
||
return c.json({ | ||
session, | ||
}); | ||
}); | ||
|
||
app.get("/all", async (c) => { | ||
const res = await auth.api.listDeviceSessions({ | ||
headers: c.req.raw.headers, | ||
return c.json({ | ||
session, | ||
}); | ||
}) | ||
.get("/all", async (c) => { | ||
const res = await auth.api.listDeviceSessions({ | ||
headers: c.req.raw.headers, | ||
}); | ||
return c.json(res); | ||
}); | ||
return c.json(res); | ||
}); | ||
|
||
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 |
---|---|---|
@@ -1,29 +1,26 @@ | ||
import { Hono } from "hono"; | ||
import { cache } from "@repo/cache"; | ||
|
||
const app = new Hono(); | ||
|
||
app.get("/", async (c) => { | ||
const dbStatus = await cache.lrange("db-latency:history", 0, -1); | ||
const siteStatus = await cache.lrange("site-latency:history", 0, -1); | ||
return c.json({ | ||
dbStatus, | ||
siteStatus, | ||
}); | ||
}); | ||
|
||
app.get("/db", async (c) => { | ||
const dbStatus = await cache.lrange("db-latency:history", 0, -1); | ||
return c.json({ | ||
dbStatus, | ||
}); | ||
}); | ||
|
||
app.get("/site", async (c) => { | ||
const siteStatus = await cache.lrange("site-latency:history", 0, -1); | ||
return c.json({ | ||
siteStatus, | ||
const app = new Hono() | ||
.get("/", async (c) => { | ||
const dbStatus = await cache.lrange("db-latency:history", 0, -1); | ||
const siteStatus = await cache.lrange("site-latency:history", 0, -1); | ||
return c.json({ | ||
dbStatus, | ||
siteStatus, | ||
}); | ||
}) | ||
.get("/db", async (c) => { | ||
const dbStatus = await cache.lrange("db-latency:history", 0, -1); | ||
return c.json({ | ||
dbStatus, | ||
}); | ||
}) | ||
.get("/site", async (c) => { | ||
const siteStatus = await cache.lrange("site-latency:history", 0, -1); | ||
return c.json({ | ||
siteStatus, | ||
}); | ||
}); | ||
}); | ||
|
||
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