1import { run } from "alepha"; 2import { $action } from "alepha/server"; 3 4class Api { 5 6 greet = $action({ 7 schema: { 8 query: t.object({ name: t.text() }), 9 response: t.object({ greeting: t.string() }),10 },11 handler: async ({ query }) => {12 return {13 greeting: `Hello, ${query.name}!`,14 };15 },16 });17}18 19run(Api);