ConservationMetrics / guardianconnector-views

A Nuxt.js tool that reads data from a SQL database and renders it on different views (map, gallery, alerts dashboard)
MIT License
3 stars 0 forks source link

Refactor API and middleware to be more modular and legible #30

Closed rudokemper closed 5 months ago

rudokemper commented 5 months ago

As the complexity of our application has increased, the index.ts and dataProcessing.ts files have become somewhat unwieldy. This PR addresses this issue by reorganizing and modularizing various API and middleware functions based on their specific concerns. Additionally, it introduces and implements new TypeScript settings to help streamline the code.

Changes to index.ts involve:

For dataProcessing.ts:

Lastly, per the stronger TypeScript config, removal of some redundant imports and types (like in authMiddleware.ts), which were remnants of past work and no longer needed.