I prefer building REST APIs in TypeScript
I prefer building REST APIs in TypeScript. Why? Because I can use the types to keep 6 separate things in sync:
1. The API request shape
2. The API response shape
3. Automated tests
4. Mock endpoint declarations
5. Mock data
6. The UI that consumes the API response
If the API request or response shape changes, I:
1. Update the relevant type
2. Lean on the compiler to find spots to update. 😎
Oh, and if you happen to be working in TypeScript on the client and server, check out @trpcio. It's 🔥.