Kaelwd
Kaelwd
HHono
Created by DJ on 10/17/2024 in #help
Is there any way to mock cookies using testing helpers?
6 replies
HHono
Created by Nicolas on 9/7/2024 in #help
Weird bug: JSON data not making it to server: RPC
Is c.req.json present if you remove the validator middleware?
3 replies
HHono
Created by Kaelwd on 9/6/2024 in #help
Trace when body is consumed
I can only reproduce it in dev if I use the etag middleware too, and even then it doesn't happen consistently it can't be node-cache cleaning up because cache.get still returns
3 replies
HHono
Created by Kaelwd on 9/6/2024 in #help
Trace when body is consumed
really weird, there's 10+ seconds between when the response is created and when it is consumed
const res = c.res.clone()
const timeout = setInterval(() => {
if (res.bodyUsed) {
c.log.debug('body used')
clearInterval(timeout)
}
})
cache.set(key, res)
const res = c.res.clone()
const timeout = setInterval(() => {
if (res.bodyUsed) {
c.log.debug('body used')
clearInterval(timeout)
}
})
cache.set(key, res)
[00:33:31.955] DEBUG: GET /one/banners 304 98ms
[00:33:32.873] DEBUG: GET /one/banners 200 2ms
[00:33:34.166] DEBUG: GET /one/banners 304 2ms
[00:33:37.971] DEBUG: GET /one/banners 304 2ms
[00:33:42.575] DEBUG: body used
[00:33:31.955] DEBUG: GET /one/banners 304 98ms
[00:33:32.873] DEBUG: GET /one/banners 200 2ms
[00:33:34.166] DEBUG: GET /one/banners 304 2ms
[00:33:37.971] DEBUG: GET /one/banners 304 2ms
[00:33:42.575] DEBUG: body used
3 replies
HHono
Created by Augustin Sorel on 8/10/2024 in #help
Error per route
Because that's the order they're called in
7 replies
HHono
Created by Augustin Sorel on 8/10/2024 in #help
Error per route
.get('/idk', errorHandler, c => {...
7 replies
HHono
Created by Augustin Sorel on 8/10/2024 in #help
Error per route
no
7 replies
HHono
Created by Augustin Sorel on 8/10/2024 in #help
Error per route
In middleware you can check c.error after await next()
7 replies
HHono
Created by Blitz on 8/1/2024 in #help
Adding Cron!
Hono is just a HTTP framework, you need another package like https://www.npmjs.com/package/croner
4 replies