エクスプレスCRUDアプリケーションに以下のフォルダ構造を使用しています。私はそれを使って、70行を超えないコードを含む各ファイルの理想的な管理可能なコードを持っています。フォルダ構造に関するあなたの考えは?ノードエクスプレスCRUDアプリケーションのフォルダ構造
- bin\
- www
- common\
- enums\
- logTypesEnum.js
- validators\
- studentNameValidator.js
- config\
- db.js # config file for database connection
- models\
- log.js # contains model data for model 'log'
- routes\
- log\
- index.js # handles all routes for /log/ endpoints and requires files in the directory and also contains middleware code
- insert.js # handles all routes for /log/insert endpoints
- remove # handles all routes for /log/remove endpoints
- exportCSV.js # handles all routes for /log/exportCSV endpoints
- student\
- index.js
- insert.js
- remove.js
- public\
- javascripts
- images
- stylesheets
- views\
- log\
- index.jade
- insert.jade
- remove.jade
- exportCSV.jade
- student\
- index.jade
- insert.jade
- app.js
70では、コードの明瞭性を維持するために、2回以下のスクロールを意味していました。あなたは、あなたの構造がとにかく許されない理想的なマイクロサービスの行についてさらにコメントしてください。この構造の特定のフォールバックを指摘すると、本当に役に立ちます。 @twgに感謝します。 –
あなたの質問に答えるために私の答えを編集しました。希望が役立つ – twg