Closed rjmk closed 7 years ago
Provided your handlers are in a /handlers
directory it should be sufficiently clarifying.
Cool. What about the name of the variable when required in? For example in a file where riot is never required directly, can we have var riot = require('./handlers/riot')
?
how are you using it? can you paste a link to the commit/file/line ?
Here is the sort of place I would consider using it: https://github.com/dwyl/hapi-socketio-redis-riot-chat-example/blob/095e4f6c3a951fb9e7ed96bb08fdaa13dc4fc0c1/server.js#L3
in that example I would just:
{ method: 'GET', path: '/', handler: require('./lib/riot_handler.js') },
No need to assign the handler to a variable before using it.
Cool :+1:
This is issue is being automatically closed as it's more than a year old. Please feel free to reopen it if it's still relevant to your project.
Putting '_handler' at the end of all your handler files gets pretty redundant and unnecessarily lengthy. On the other hand, calling your riot or redis handler something like 'riot' or 'redis' is pretty confusing. What should we do??? :question: