Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Controllers without boilerplate #45

Closed
akyoto opened this issue Nov 9, 2015 · 1 comment
Closed

Controllers without boilerplate #45

akyoto opened this issue Nov 9, 2015 · 1 comment

Comments

@akyoto
Copy link
Collaborator

akyoto commented Nov 9, 2015

Example:

  • page.get.js
  • page.post.js

These files wouln't need to include the controller object & function boilerplate:

module.exports = {
    get: function(request, response) {
        response.end('Hello World')
    }
}

So the content of page.get.js would simply be the bare minimum:

response.end('Hello World')

The only problem is how request and response should be named since this is very opinionated.
Personally I prefer to not use abbreviations because we have autocomplete for a reason. So I'd go with the names I just mentioned.

Implementation

page.get.js should simply be compiled into a module that exports the get function. The get function is then assigned to the either existing or automatically created controller object.

@akyoto akyoto added this to the 0.8.0 milestone Nov 9, 2015
@akyoto akyoto added the maybe label Nov 11, 2015
@akyoto
Copy link
Collaborator Author

akyoto commented Nov 12, 2015

Probably not going to be implemented.
After all I don't like doing too many things implicitly.
Will think about it again when I have more free time.

@akyoto akyoto closed this as completed Nov 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant