generated from thaitype/npm-typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactor more lean remove azure function deps
- Loading branch information
1 parent
1f8c6d4
commit f063522
Showing
13 changed files
with
2,983 additions
and
2,555 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { createTRPCProxyClient, httpBatchLink, loggerLink } from '@trpc/client'; | ||
import type { AppRouter } from './trpc'; | ||
|
||
const sleep = (ms = 100) => new Promise((resolve) => setTimeout(resolve, ms)); | ||
|
||
async function main() { | ||
const url = 'http://127.0.0.1:7071/api/trpc'; | ||
|
||
const proxy = createTRPCProxyClient<AppRouter>({ | ||
links: [loggerLink(), httpBatchLink({ url })], | ||
}); | ||
|
||
await sleep(); | ||
|
||
const greet = await proxy.greet.query(); | ||
// const greet = await proxy.greet.query({ text: 'client' }); | ||
console.log('created post', greet); | ||
await sleep(); | ||
|
||
|
||
|
||
console.log('👌 should be a clean exit if everything is working right'); | ||
} | ||
|
||
main().catch(console.error); |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { createAzureFunctionsHandler } from 'trpc-azure-functions-adapter'; | ||
import { appRouter, createContext } from './trpc'; | ||
import { app } from '@azure/functions'; | ||
|
||
app.http('trpc', { | ||
methods: ['GET', 'POST'], | ||
authLevel: 'anonymous', | ||
route: 'trpc/{x:regex(^[^\\/]+$)}', | ||
handler: createAzureFunctionsHandler({ | ||
router: appRouter, | ||
createContext, | ||
}), | ||
}); |
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
38 changes: 0 additions & 38 deletions
38
packages/trpc-azure-functions-adapter/src/azure-functions.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.