Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular code needed #2

Open
ArunTeltia opened this issue Feb 9, 2021 · 4 comments
Open

Modular code needed #2

ArunTeltia opened this issue Feb 9, 2021 · 4 comments
Assignees
Labels
epic this require many sub issues to be created and many files is this will get affected good first issue Good for newcomers gssoc21 help wanted Extra attention is needed level3

Comments

@ArunTeltia
Copy link
Member

There is a need of making the code modular.
like putting all the anime streaming route in one folder, loader in one folder and manga reader in one folder

@ArunTeltia ArunTeltia added good first issue Good for newcomers help wanted Extra attention is needed labels Feb 9, 2021
@singhayushh
Copy link
Collaborator

singhayushh commented Mar 10, 2021

I am willing to take up this issue.

I have another suggestion regarding the code modularity. Currently the controller functions for each of the routes are written right inside the route definition. Example:

router.get("/", function (req, res, next) {
  request(
    "https://www.gogoanime1.com/search/topSearch?q=" + req.query.q,
    (error, response, html) => {
      res.send(response.body);
    }
  );
});

A good convention to follow is to create a controllers/ directory and have all these controller functions (let's call the above handler function as topSearchHandler) in there so that the api end point just has to call the function:

router.get("/", topSearchHandler)

@ArunTeltia
Copy link
Member Author

Yeah sounds reasonable, can you create an issue for this as well so that we don't forget the main aim if this issue.
If you want to work on this issue, you can break this issue into parts as this is one of the epic issue that require many files to get changed
Assigning this issue to you

@ArunTeltia ArunTeltia added gssoc21 epic this require many sub issues to be created and many files is this will get affected level3 refractor the code needs to be refactored to make it concise labels Mar 10, 2021
@singhayushh
Copy link
Collaborator

Thank you. I'll do that.

Also, there a typo in the issue label refractor should be refactor I guess. 😅

@ArunTeltia ArunTeltia removed the refractor the code needs to be refactored to make it concise label Mar 10, 2021
@ArunTeltia
Copy link
Member Author

Yeah Removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic this require many sub issues to be created and many files is this will get affected good first issue Good for newcomers gssoc21 help wanted Extra attention is needed level3
Projects
None yet
Development

No branches or pull requests

2 participants