Skip to content

Commit 55645fc

Browse files
feat: add routes.ts
1 parent a9a9553 commit 55645fc

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

app/routes.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { type RouteConfig } from '@react-router/dev/routes'
2+
import { remixRoutesOptionAdapter } from '@react-router/remix-routes-option-adapter'
3+
import { flatRoutes } from 'remix-flat-routes'
4+
5+
export default remixRoutesOptionAdapter((defineRoutes) => {
6+
return flatRoutes('routes', defineRoutes, {
7+
ignoredRouteFiles: [
8+
'.*',
9+
'**/*.css',
10+
'**/*.test.{js,jsx,ts,tsx}',
11+
'**/__*.*',
12+
// This is for server-side utilities you want to colocate
13+
// next to your routes without making an additional
14+
// directory. If you need a route that includes "server" or
15+
// "client" in the filename, use the escape brackets like:
16+
// my-route.[server].tsx
17+
'**/*.server.*',
18+
'**/*.client.*',
19+
],
20+
})
21+
}) satisfies RouteConfig

app/routes/admin+/cache.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default function CacheAdminRoute() {
9898
const handleFormChange = useDebounce(async (form: HTMLFormElement) => {
9999
await submit(form)
100100
}, 400)
101-
101+
2
102102
return (
103103
<div className="container">
104104
<h1 className="text-h1">Cache Admin</h1>

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"@react-email/components": "0.0.30",
6565
"@react-router/express": "^7.0.0",
6666
"@react-router/node": "^7.0.0",
67+
"@react-router/remix-routes-option-adapter": "^7.1.1",
6768
"@sentry/profiling-node": "^8.42.0",
6869
"@sentry/remix": "^8.42.0",
6970
"address": "^2.0.3",

0 commit comments

Comments
 (0)