I
I
IUserInterface2021-04-13 12:35:47
ASP.NET
IUserInterface, 2021-04-13 12:35:47

What is the best way to organize mvc controllers?

I am currently developing a simple music streaming service as a pet project (like spotify or Yandex music), and I have a question: "how is it better to distribute responsibilities between MVC controllers?". For example: Do I need to create a separate controller for user login/registration, downloading/managing music, etc.?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-04-13
@vabka

It seems to me - yes.
Personally, in my project I divide them by resources -
A separate controller for authentication, a separate one for other entities, one more for others.
It turns out something like
/api/auth
/api/entity1
/api/entity2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question