codecombat/codecombat — pull request #275 by smoratinos (2014-01-23 00:08:20+00:00)
Title: Suggestion : Server package by feature

## Some re-organization

* move routes files (HTTP endpoint) in a new "routes" folder

* server reorganize files and folder by features

- move and rename files
- use associative arrays which store handlers for 'dynamically'
load module from de db route
- store models_path in test/server/common,
a global model variable has the same name that the filename of the model

* remove unused modules

## Now, I'm trying to break some dependencies

* user_handler need /routes/languages
* user_handler need request
* commons/schemas need /routes/languages
* LevelDraft need Level
* plugins need User

## Some reflexions

commons/errors need to be move to routes/errors
but before that, we must break dependency from Handler to errors.
For this, Handler must throw exception and routes must intercept exception and call errors.
Handler don't need to be HTTP dependent.