-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: docs api endpoint from trpc to analogjs server call
- Loading branch information
1 parent
7393eb0
commit f847689
Showing
7 changed files
with
33 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { PageServerLoad } from '@analogjs/router'; | ||
|
||
export const load = async ({ fetch }: PageServerLoad) => { | ||
return await fetch('/api/primitive-api'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineEventHandler } from 'h3'; | ||
import docsData from '../../public/data/ui-api.json'; | ||
|
||
export default defineEventHandler(() => { | ||
return docsData; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { router } from '../trpc'; | ||
import { docsRouter } from './docs'; | ||
import { noteRouter } from './notes'; | ||
|
||
export const appRouter = router({ | ||
note: noteRouter, | ||
docs: docsRouter, | ||
note: noteRouter | ||
}); | ||
// export type definition of API | ||
export type AppRouter = typeof appRouter; |