Skip to content

Instantly share code, notes, and snippets.

@nahtnam
Created July 27, 2017 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahtnam/23a3da94b92c86ab8dbf5bf138f6fd47 to your computer and use it in GitHub Desktop.
Save nahtnam/23a3da94b92c86ab8dbf5bf138f6fd47 to your computer and use it in GitHub Desktop.
// A
module.exports = (ctx, next) => {
return ctx.view({ data });
}
module.exports = (data) => {
data.test = false;
return ctx.render({ data })
}
// B
module.exports = class Endpoint extends Konstructor.Endpoint {
controller() {
return this.view({ data });
}
view(data) {
data.test = false;
return this.render({ data }); // This is a hidden function in Konstructor.Endpoint
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment