forget it for now
This commit is contained in:
parent
c7fa05f224
commit
ab47945222
11
README.md
11
README.md
|
|
@ -2,14 +2,3 @@
|
||||||
|
|
||||||
don't ask
|
don't ask
|
||||||
|
|
||||||
## basic auth
|
|
||||||
|
|
||||||
users:
|
|
||||||
|
|
||||||
- corey
|
|
||||||
- defunkt
|
|
||||||
- spike
|
|
||||||
|
|
||||||
password:
|
|
||||||
|
|
||||||
- 888
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { Hono } from "hono"
|
import { Hono } from "hono"
|
||||||
import { upgradeWebSocket, websocket } from "hono/bun"
|
import { upgradeWebSocket, websocket } from "hono/bun"
|
||||||
import { basicAuth } from "hono/basic-auth"
|
|
||||||
import { uniqueNamesGenerator, adjectives, animals } from "unique-names-generator"
|
import { uniqueNamesGenerator, adjectives, animals } from "unique-names-generator"
|
||||||
|
|
||||||
type Request = {
|
type Request = {
|
||||||
|
|
@ -31,16 +30,6 @@ const app = new Hono
|
||||||
|
|
||||||
app.get("/health", c => c.text("ok"))
|
app.get("/health", c => c.text("ok"))
|
||||||
|
|
||||||
const users = ["corey", "defunkt", "spike"]
|
|
||||||
const password = "888"
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "production") {
|
|
||||||
app.use(basicAuth({
|
|
||||||
verifyUser: (username, pass) =>
|
|
||||||
users.includes(username) && password === pass
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
app.get("/tunnels", c => {
|
app.get("/tunnels", c => {
|
||||||
return c.html(<ul>
|
return c.html(<ul>
|
||||||
{Object.keys(connections).map(key =>
|
{Object.keys(connections).map(key =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user