Skip to content

Commit 55c7fdd

Browse files
committed
refactor!: reword: RouteApp => Route
1 parent 0156b80 commit 55c7fdd

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

apps/backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Again, the recommended structure is to mirror the api url path, but, if for some
3737

3838
#### Hono `app` export naming conventions:
3939
* Root and main app entries (app.ts, $.ts) should be named as: `<Name>App`, and it should only `.route` other instances or `.use` middlewares, do not define routes on the `App` instance.
40-
* For other app entries, a.k.a routes defines, it should be named as: `<Name>RouteApp`, i.e: `/api/dummy/hello.ts` should be named as `dummyHelloRouteApp`/`helloRouteApp`.
40+
* For other app entries, a.k.a routes defines, it should be named as: `<Name>Route`, i.e: `/api/dummy/hello.ts` should be named as `dummyHelloRoute`/`helloRoute`.
4141

4242
## Notes & Guides
4343

apps/backend/src/api/$$.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { appFactory } from '#src/helpers/factory.js'
22

3-
export const apiRouteApp = appFactory.createApp()
3+
export const apiRoute = appFactory.createApp()
44
.get('', async c => c.text('OK'))

apps/backend/src/api/$.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { appFactory } from '#src/helpers/factory.js'
2-
import { apiRouteApp } from './$$'
2+
import { apiRoute } from './$$'
33
import { authApp } from './auth/$'
4-
import { dummyConvexTasksRouteApp } from './dummy/convexTasks'
5-
import { dummyGreetRouteApp } from './dummy/greet'
6-
import { dummyHelloRouteApp } from './dummy/hello'
4+
import { dummyConvexTasksRoute } from './dummy/convexTasks'
5+
import { dummyGreetRoute } from './dummy/greet'
6+
import { dummyHelloRoute } from './dummy/hello'
77

88
export const apiApp = appFactory.createApp()
99
// Simple health check route
10-
.route('', apiRouteApp)
10+
.route('', apiRoute)
1111

1212
// Auth app - you'll need to setup Kinde environment variables.
1313
.route('/auth', authApp)
1414

1515
// Some example routes
16-
.route('/dummy/convexTasks', dummyConvexTasksRouteApp)
17-
.route('/dummy/hello', dummyHelloRouteApp)
18-
.route('/dummy/greet', dummyGreetRouteApp)
16+
.route('/dummy/convexTasks', dummyConvexTasksRoute)
17+
.route('/dummy/hello', dummyHelloRoute)
18+
.route('/dummy/greet', dummyGreetRoute)
1919

2020
// ### This block contains the sample code for streaming APIs,
2121
// import type { TypedResponse } from 'hono'

apps/backend/src/api/dummy/convexTasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type } from 'arktype'
44
import { api } from 'backend-convex/convex/_generated/api'
55
import { describeRoute, resolver } from 'hono-openapi'
66

7-
export const dummyConvexTasksRouteApp = appFactory.createApp()
7+
export const dummyConvexTasksRoute = appFactory.createApp()
88
.get(
99
'',
1010
describeRoute({

apps/backend/src/api/dummy/greet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { i18nComposer } from '#src/helpers/i18n.js'
44
import { type } from 'arktype'
55
import { describeRoute, resolver } from 'hono-openapi'
66

7-
export const dummyGreetRouteApp = appFactory.createApp()
7+
export const dummyGreetRoute = appFactory.createApp()
88
.get(
99
'',
1010
describeRoute({

apps/backend/src/api/dummy/hello.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { appFactory } from '#src/helpers/factory.js'
22
import { getConvexClient } from '#src/providers/baas/convex-main.js'
33
import { getHelloMessage } from './hello.helper'
44

5-
export const dummyHelloRouteApp = appFactory.createApp()
5+
export const dummyHelloRoute = appFactory.createApp()
66
.get('', async (c) => {
77
const convexClient = await getConvexClient().catch(() => null)
88

0 commit comments

Comments
 (0)