3 ms·
If you have .NET 6/7 installed, give this a try: dotnet new webapi -minimal dotnet run I know there's been a lot of discussion about whether .NET/C# a
by CharlieDigital 4y ago
If you have .NET 6/7 installed, give this a try:
dotnet new webapi -minimal
dotnet run
I know there's been a lot of discussion about whether .NET/C# are faster than X or Y or Z based on TechEmpower benchmarks, but this will give you a backend that looks more or less like Express with an OpenAPI schema built-in (generate TS bindings for frontend) and a runtime that is going to be higher thoughput than Express or Node.
dotnet watch
And you get hot reload.
- brushfoot 4y agoThat's not what GP is talking about, though. I like the new .NET minimal APIs, but what GP is talking about is the frontend/backend _integration_ with a framework like Next.js. Next isn't really like Angular in that you don't need an API layer (though you can have one if needed). It's more like ASP.NET Core MVC. The difference is the frontend code is truly integrated with the backend. It all lives in the same project. It's just React components. You can render them statically on the server at build time, per request at runtime, or on the client. And you can mix and match. Next only ships the client the JavaScript it needs. You don't need an API unless you want SPA parts of the app. Where you do want that, it's simple to implement, because you're already in JavaScript and all your other code plays nicely with it. It's a really nice way to organize and consolidate the different pieces of web dev IMO.