Crazy Rabbit
02/15/2023, 6:20 PMVonarian
02/15/2023, 6:20 PMCrazy Rabbit
02/15/2023, 6:20 PMCrazy Rabbit
02/15/2023, 6:20 PMdave
02/15/2023, 8:37 PMdave
02/15/2023, 8:39 PMdave
02/15/2023, 8:41 PMdave
02/15/2023, 9:41 PMaaronsean
02/15/2023, 10:48 PMdave
02/15/2023, 11:35 PMtypescript
import { Hono } from 'hono'
import { basicAuth } from 'hono/basic-auth'
const app = new Hono<{ Bindings: Env }>()
app.get('/auth/page', basicAuth({ username: 'hono', password: 'acoolproject' }), (c) => {
return c.text('Page test')
})
Unsmart | Tech debt
02/15/2023, 11:36 PM(c) => basicAuth({ username: c.env.username, password: c.env.password })(c)
Unsmart | Tech debt
02/15/2023, 11:36 PMdave
02/15/2023, 11:37 PMtypescript
app.get('/test', (c) => basicAuth({ username: c.env.username, password: c.env.password })(c), (c) => {
return c.text('Page test2')
})
Unsmart | Tech debt
02/15/2023, 11:37 PMdave
02/15/2023, 11:38 PMtypes.d.ts(11, 145): An argument for 'next' was not provided.
Unsmart | Tech debt
02/15/2023, 11:39 PMdave
02/15/2023, 11:40 PMtypescript
app.get('/test', (c, ...params) => basicAuth({ username: c.env.USER, password: c.env.PASS }), (c, ..params) => {
return c.text('Page test2')
})
Unsmart | Tech debt
02/15/2023, 11:40 PMdave
02/15/2023, 11:41 PMNo overload matches this call.
The last overload gave the following error.
Argument of type '(c: Context<string, { Bindings: Env; }, unknown>, next: Next) => MiddlewareHandler<string, Environment, any>' is not assignable to parameter of type 'Handler<string, { Bindings: Env; }, unknown>'.
Type 'MiddlewareHandler<string, Environment, any>' is not assignable to type 'Response | Promise<void | Response | undefined>'.
dave
02/15/2023, 11:41 PMUnsmart | Tech debt
02/15/2023, 11:41 PMts
app.get('/test', (c, ...params) => basicAuth({ username: c.env.username, password: c.env.password })(c, ...params), (c) => {
return c.text('Page test2')
})
dave
02/15/2023, 11:43 PMdave
02/15/2023, 11:48 PMdave
02/15/2023, 11:49 PMdave
02/15/2023, 11:57 PMworkers_dev = true
create publicly reachable *.workers.dev
target while doing wrangler dev
?dave
02/15/2023, 11:58 PMCyb3r-Jok3
02/16/2023, 12:01 AMwrangler dev
it uses the *.workers.dev route for your workerdave
02/16/2023, 12:02 AMKatze
02/16/2023, 1:06 AM