Separate Web and API concepts?
I think that it would benefit those using this project to have an option which is API only as opposed to a traditional Web project which also includes the API within.
Pulling out controllers and views which are redundant can be tedious.
If a web project is also desired, it could be also be included. It could take a "Connected Services" dependency on the API via it's generated Swagger document.
I'm with you 100% and the next version will be API -only (or will have that as an option, anyway)
Perhaps it's time for a pair of templates:
- CleanApi
- CleanWeb
Thoughts? Add emoji to this comment.
I think a single template would still be sufficient.
If you only want the API, just delete the Web project.
If you want the web, you would need an API to power it. The "add connected service" feature in VS would be able to connect the two... Or for a more independent version, a tool can generate the client from the API project.
That's just my two cents though. Perhaps that's being " too clever " and two separate projects would suffice.
Hey @ardalis! Yesterday, I was thinking about this. I believe having separate templates for MVC, Razor Pages, WebApi, ApiEndpoints, and FastEndpoints, could make the development process a lot smoother and easier, especially for beginners.
Yesterday, I was thinking about this. I believe having separate templates for MVC, Razor Pages, WebApi, ApiEndpoints, and FastEndpoints, could make the development process a lot smoother and easier, especially for beginners.
For sure! But it would also multiply the effort of maintaining the templates by N (where N is the number of variants). Unless I come up with some code generation approach or something that reduces that effort, I'm not sure how soon I'll be able to support that many variations. Since my own use cases recently are mostly APIs, I'm probably going to support that as the primary "default" version and provide instructions on how to add Razor Pages or MVC Views to that template if needed, is my current thought. Open to ideas and contributions, though.