prdn / pigato

PIGATO - an high-performance Node.js microservices framework
http://prdn.github.io/pigato/
MIT License
301 stars 31 forks source link

refactor: Simplify configuration reading mechanism #69

Closed oprearocks closed 7 years ago

oprearocks commented 7 years ago

As per the official Node.js documentation the module system works in multiple ways. One way is LOAD_AS_FILE(X) where if X.json is an actual file, X.json is parsed as a JavaScript Object. (see LOAD_AS_FILE -- 3.)

https://nodejs.org/dist/latest-v6.x/docs/api/modules.html#modules_all_together

Signed-off-by: Adrian Oprea adrian@oprea.rocks

refactor: Remove unused FileSystem module

Using require to read and parse JSON out of the config file makes requiring the fs module as a dependency unnecessary.

Signed-off-by: Adrian Oprea adrian@oprea.rocks