Cryrivers / manta-style

🚀 The futuristic API Mock Server for Frontend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support to read request params

Cryrivers opened this issue · comments

I have a suggestion, how about not using magic type unstable_Query,
we define mock endpoints as function?

like:

export type GET = {
  // backward compatible
  "/user/profile": WithResponse<UserProfile>;
  // no param
  "/user/profile": () => WithResponse<UserProfile>;
  // param
  "/user/profile": (getParam: GetParam<{id: string}>) => WithResponse<UserProfile>;
}

Could elaborate more on it?