Skip to content

Commit fb31a9a

Browse files
committed
fix: run the ts file directly instead of the compiled js
1 parent 256fcfc commit fb31a9a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

bun.lockb

-6 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
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"

src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Elysia } from "elysia"
22
import { swagger } from "@elysiajs/swagger"
33
import { serverTiming } from "@elysiajs/server-timing"
4-
import { autoroutes } from "elysia-autoroutes"
4+
import { autoload } from "elysia-autoload"
55
import { ip } from "elysia-ip"
66
export { t } from "elysia"
77
export { 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

3939
app.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

4348
app.use(
4449
swagger({

0 commit comments

Comments
 (0)