I utilized typescript for both the frontend (Angular) and backend (Express).
To ensure type definitions are shared, I created a file called shared-type-file.ts
.
interface Kid{
name: string;
age: number;
}
By then running npm install
in both the frontend and backend, my data structure was accurately defined across systems which greatly benefited me.
Now, if I decide to switch my server to Go (potentially go-fiber), how can I achieve a similar functionality? How do I maintain type-checked data structures across these systems?