first
This commit is contained in:
19
src/routers/handler.ts
Normal file
19
src/routers/handler.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import Txt23DHandler from "../biz/txt23d";
|
||||
import Txt2ImgHandler from "../biz/txt2img";
|
||||
import UpscaleHandler from "../biz/upScale";
|
||||
import { RegistHandler } from "../utils/register";
|
||||
// 首页路由
|
||||
const HelloworldHandler = async (ctx: any) => {
|
||||
ctx.body = "helloworld";
|
||||
}
|
||||
const InitHandler = () => {
|
||||
RegistHandler("post", "/txt2img", Txt2ImgHandler);
|
||||
RegistHandler("options", "/txt2img", Txt2ImgHandler);
|
||||
RegistHandler("post", "/txt23d", Txt23DHandler);
|
||||
RegistHandler("options", "/txt23d", Txt23DHandler);
|
||||
RegistHandler("options", "/upscale", UpscaleHandler);
|
||||
RegistHandler("post", "/upscale", UpscaleHandler);
|
||||
}
|
||||
|
||||
|
||||
export default InitHandler;
|
||||
3
src/routers/router.ts
Normal file
3
src/routers/router.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import Router from "koa-router";
|
||||
const router = new Router();
|
||||
export default router;
|
||||
Reference in New Issue
Block a user