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

Refactoring news-routes to be simpler and not using setInterval #463

Merged
merged 1 commit into from Nov 13, 2023

Conversation

fcaps
Copy link
Collaborator

@fcaps fcaps commented Nov 12, 2023

This is related to #454

  1. there was no reason to go the complicated way and render news in the browser
  2. there was no reason to use the setInterval in getNews.js router.get(/news/${page}) -> replaced with router.get(/news/:slug)
  3. updated the news-slug to be actual url safe, but to not break any public links there is a fallback + redirect
  4. started to use routers app.use("/news", newsRouter) to the express.js is not cluttered with code

Since the setInterval was adding so many routes to express, this has a good chance to be memory-leaking piece of code

@Sheikah45
Copy link
Member

Just a quick note on your first point that we have to make sure the newshub still works with the client. As the news is just the rendering of the news page.

From the code I suspect you mean the individual articles but wanted to make sure.

@fcaps
Copy link
Collaborator Author

fcaps commented Nov 13, 2023

Copy link
Member

@Brutus5000 Brutus5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really follow all changes, but we'll see on test

@Brutus5000 Brutus5000 merged commit a2cbb14 into FAForever:develop Nov 13, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants