File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import { Hono } from "hono" ;
2+ import { cors } from "hono/cors" ;
23import { getCookie } from "hono/cookie" ;
34import { createClient } from "redis" ;
45
@@ -16,11 +17,18 @@ type TModel = {
1617} ;
1718
1819const app = new Hono ( ) ;
20+ app . use (
21+ "*" ,
22+ cors ( {
23+ origin : "*" ,
24+ credentials : true ,
25+ } ) ,
26+ ) ;
1927
2028const create = ( userId : string , value : TModel ) => {
2129 client . set (
2230 `${ userId } :${ value . method } :${ value . path } ` ,
23- JSON . stringify ( { status : value . status , data : value . data } )
31+ JSON . stringify ( { status : value . status , data : value . data } ) ,
2432 ) ;
2533} ;
2634
@@ -36,7 +44,7 @@ const clear = async (userId: string) => {
3644const get = (
3745 userId : string ,
3846 method : string ,
39- path : string
47+ path : string ,
4048) : ReturnType < typeof client . get > => {
4149 return client . get ( `${ userId } :${ method } :${ path } ` ) ;
4250} ;
You can’t perform that action at this time.
0 commit comments