From e1aadc0de5489742abb56d5d27d0c4373555348d Mon Sep 17 00:00:00 2001 From: garrettmills Date: Mon, 8 Mar 2021 12:35:05 -0600 Subject: [PATCH] Add basic home page and target ES6 --- src/app/http/controllers/main/Home.controller.ts | 14 ++++++++++++-- tsconfig.json | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/http/controllers/main/Home.controller.ts b/src/app/http/controllers/main/Home.controller.ts index 8c45881..d2ceb27 100644 --- a/src/app/http/controllers/main/Home.controller.ts +++ b/src/app/http/controllers/main/Home.controller.ts @@ -1,7 +1,17 @@ -import { Controller, Request } from '@extollo/lib'; +import {Controller, html, Session} from '@extollo/lib'; +import {Inject, Injectable} from "@extollo/di"; +@Injectable() export class Home extends Controller { + @Inject() + protected readonly session!: Session; + public welcome() { - console.log('welcome', this.request) + this.session.set('app_visits', this.session.get('app_visits', 0) + 1) + + return html(` +

Welcome to Extollo!

+

You have visited this page ${this.session.get('app_visits')} times.

+ `) } } diff --git a/tsconfig.json b/tsconfig.json index f764f26..637b913 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es6", "module": "commonjs", "declaration": true, "outDir": "./lib",