Ts — Encore

import SQLDatabase from "encore/storage"; // This single line provisions a real database in dev/prod const db = new SQLDatabase("user-db", migrations: "./migrations", );

// Backend: my-app/hello.ts interface PingParams name: string export const ping = api( method: "POST", path: "/ping/:name", expose: true , async (params: PingParams): Promise< message: string > => return message: Hello, $params.name! ; encore ts

);

When you deploy, Encore.ts parses this, creates the necessary cloud resources (RDS, Cloud SQL, etc.), and runs your migrations automatically. Forget generating OpenAPI specs (Swagger) and praying your frontend matches. With Encore.ts, your backend endpoints define request/response shapes, and Encore automatically generates a fully type-safe TypeScript client: import SQLDatabase from "encore/storage"

Post a Comment

0 Comments

Please Select Embedded Mode To show the Comment System.*

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!