'use strict';

import { controller, get, inject } from 'kikwit';

<% if (logger) { %>@inject('logger') /* injects the Logger service (Logger class from services/ folder) */ <% } -%>    
@controller
export class Home {

    @inject('adder') /* injects the Adder service (Adder class from services/ folder) */
    @get
    index(ctx) {

        const [a, b] = [2, 3];
        
        const sum = ctx.services.adder.add(a, b); /* adder provided by @inject('adder') */
<% if (logger) { %>
        ctx.services.logger.info(`${a} + ${b} = ${sum}`); /* logger provided by @inject('logger') */
<% } -%>         
<% if (appType == 'api') { -%> 
        const message = { a, b, sum };

        ctx.sendJSON(message);
    }
}
<% } else if (appType == 'website') { -%>
        const message = `${a} + ${b} = ${sum}`;
            <% if (viewEngine) { %>
        ctx.render({ message });
            <% } else { %>
        ctx.send(message);
            <% } %>
    }
}
<% } %>

@@ -321,18 +321,22 @@
  index(c
+ontex
 t
-x
 ) %7B%0A%0A   
@@ -393,18 +393,22 @@
  sum = c
+ontex
 t
-x
 .service
@@ -496,18 +496,22 @@
        c
+ontex
 t
-x
 .service
@@ -687,26 +687,30 @@
 ;%0A%0A        c
+ontex
 t
-x
 .sendJSON(me
@@ -860,18 +860,22 @@
        c
+ontex
 t
-x
 .render(
@@ -928,10 +928,14 @@
    c
+ontex
 t
-x
 .sen

Update home.js