NodeJS APIs folder structure
there is no right in wrong in this situation it's a question of what's best for your particular situation if you are going to build many Rest API endpoints it's best to separate them in separate files under routes like this so your code can be more maintainable :

│   ├── routes/
|   |         |___index.js
              |___auth.js
              |___gizmo.js
                          -