@microsoft.azure/autorest.testserver
Version:
Autorest test server.
25 lines (22 loc) • 509 B
text/typescript
import { app, json } from "../../api";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
app.category("example" as any, () => {
app.get("/test", "GetMyTest", (req) => {
return {
status: 200,
body: json({
foo: "succeeded",
bar: "wut",
}),
};
});
app.post("/test", "PostMyTest", (req) => {
req.expect.bodyEquals({ foo: "123", bar: "456" });
return {
status: 200,
body: json({
succeeded: true,
}),
};
});
});