Initial commit
This commit is contained in:
18
packages/common/src/contracts/hello.ts
Normal file
18
packages/common/src/contracts/hello.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { initContract } from "@ts-rest/core";
|
||||
import z from "zod";
|
||||
|
||||
const c = initContract();
|
||||
|
||||
export const contracts = c.router({
|
||||
hello: {
|
||||
method: "GET",
|
||||
path: "/hello",
|
||||
responses: {
|
||||
200: z.object({
|
||||
payload: z.string(),
|
||||
}),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
type C = typeof contracts;
|
||||
1
packages/common/src/contracts/index.ts
Normal file
1
packages/common/src/contracts/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./hello";
|
||||
1
packages/common/src/index.ts
Normal file
1
packages/common/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./contracts/index";
|
||||
Reference in New Issue
Block a user