Summary:
1. Don't publicly expose endpoints that are either slow or require a ton of resources.
2. If you can't get rid of a slow endpoint; put authentication in front of it so you have a lever to pull in the event of an attack.
3. Throttle / rate limit everything with high barriers so not to impede normal traffic patterns.
4. Don't make it easy for someone to DoS you; reduce or eliminate well-know attack vectors and vulnerabilities.
5. Scan your app for regex and zip bombs.
6. The bad guys will sniff-out your N+1 queries, so fix them.
7. If necessary: pay for DDoS mitigation from a cloud provider.