chore: kanban template
This commit is contained in:
33
src/scaffold/rpc-remote.gen.ts
Normal file
33
src/scaffold/rpc-remote.gen.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.23
|
||||
*/
|
||||
/**
|
||||
* Auto-generated remote internal RPC queue worker and HTTP endpoint
|
||||
* Do not edit manually - regenerate with 'npx pikku'
|
||||
*/
|
||||
import { pikkuSessionlessFunc, wireHTTP, wireQueueWorker } from '@project/functions/.pikku/pikku-types.gen.js'
|
||||
import { pikkuRemoteAuthMiddleware } from '@pikku/core/middleware'
|
||||
|
||||
export const remoteRPCHandler = pikkuSessionlessFunc<
|
||||
{ rpcName: string, data?: unknown },
|
||||
unknown
|
||||
>({
|
||||
tags: ['pikku'],
|
||||
func: async (_services, { rpcName, data }, { rpc }) => {
|
||||
return await (rpc.invoke as any)(rpcName, data)
|
||||
},
|
||||
remote: true,
|
||||
})
|
||||
|
||||
wireQueueWorker({
|
||||
name: 'pikku-remote-internal-rpc',
|
||||
func: remoteRPCHandler,
|
||||
})
|
||||
|
||||
wireHTTP({
|
||||
route: '/remote/rpc/:rpcName',
|
||||
method: 'post',
|
||||
auth: false,
|
||||
middleware: [pikkuRemoteAuthMiddleware],
|
||||
func: remoteRPCHandler,
|
||||
})
|
||||
Reference in New Issue
Block a user