samrg472 avatar

Refactoring and Cleaning the Utopian API [Part 2]

samrg472

Published: 22 Nov 2017 › Updated: 22 Nov 2017Refactoring and Cleaning the Utopian API [Part 2]

Refactoring and Cleaning the Utopian API [Part 2]

I've been doing a ton of work cleaning up the repository for the Utopian API. Unused routes and dead code have been removed as a result. The repository root is now a lot tidier. All of the scripts used are now located under the src folder.

The Mongoose models are now strictly typed thanks to Typescript. This means refactoring any of the DB functionality will be much easier since you will see a compilation error. The project in its entirety is now ready for strict typing.

MONGO_HOST is no longer hardcoded in the NPM scripts. It must now be specified in the environment variables.

All project dependencies have been updated. Babel has been dropped entirely in favor of Typescript. This means that all the unit tests have been converted to Typescript as well.

Logging has been improved. The output formatting of express logs have been changed. There is no more JSON output. If there's an error in a request it will be logged accordingly and is now easy to get to. No longer is it a monster to go through the logs to see where things can go wrong. The unnecessary Morgan logger has been removed. Winston is the only primary logging system now used.

View all the commits at once: https://github.com/utopian-io/api.utopian.io/commits/master
Commits:



Posted on Utopian.io - Rewarding Open Source Contributors

Leave Refactoring and Cleaning the Utopian API [Part 2] to:

Written by

Creator of @steemdunk, Follower of The Lord.

Read more #utopian-io posts


Best Posts From samrg472