Refactoring 2
This commit is contained in:
parent
dd14dfe72e
commit
e4b78ceec2
76 changed files with 870 additions and 734 deletions
18
packages/bridge-ui/lib/routing.ts
Normal file
18
packages/bridge-ui/lib/routing.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { ServiceParams } from "./service";
|
||||
import { getService } from "./utils";
|
||||
|
||||
export const getBot = async (
|
||||
_req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> => getService(params)?.getBot(params);
|
||||
|
||||
export const sendMessage = async (
|
||||
req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> => getService(params)?.sendMessage(req, params);
|
||||
|
||||
export const handleWebhook = async (
|
||||
req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> => getService(params)?.handleWebhook(req);
|
||||
Loading…
Add table
Add a link
Reference in a new issue