File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1515 "@supabase/supabase-js" : " ^2.43.6" ,
1616 "bun" : " ^1.1.17" ,
1717 "elysia" : " ^1.0.25" ,
18- "elysia-autoroutes " : " ^0.5 .0" ,
18+ "elysia-autoload " : " ^1.7 .0" ,
1919 "elysia-ip" : " ^1.0.7" ,
2020 "elysia-rate-limit" : " ^4.1.0" ,
2121 "latest" : " ^0.2.0"
Original file line number Diff line number Diff line change 11import { Elysia } from "elysia"
22import { swagger } from "@elysiajs/swagger"
33import { serverTiming } from "@elysiajs/server-timing"
4- import { autoroutes } from "elysia-autoroutes "
4+ import { autoload } from "elysia-autoload "
55import { ip } from "elysia-ip"
66export { t } from "elysia"
77export { rateLimit } from "elysia-rate-limit"
@@ -32,13 +32,18 @@ app.onResponse((response) => {
3232 }
3333
3434 console . log (
35- `[${ timestamp } ]: [${ icon } ${ status } ] ${ userAgent } ${ ip + " " ?? "" } - ${ request . method } ${ path } `
35+ `[${ timestamp } ]: [${ icon } ${ status } ] ${ userAgent } ${ ip ? ip + " " : "" } - ${ request . method } ${ path } `
3636 )
3737} )
3838
3939app . use ( ip ( { headersOnly : true } ) )
4040
41- app . use ( autoroutes ( ) )
41+ app . use (
42+ await autoload ( {
43+ dir : "./routes" ,
44+ ignore : [ "**/*.test.ts" , "**/*.spec.ts" ]
45+ } )
46+ )
4247
4348app . use (
4449 swagger ( {
You can’t perform that action at this time.
0 commit comments