Add basic home page and target ES6

master
Garrett Mills 3 years ago
parent 906af49d29
commit e1aadc0de5
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

@ -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 { export class Home extends Controller {
@Inject()
protected readonly session!: Session;
public welcome() { public welcome() {
console.log('welcome', this.request) this.session.set('app_visits', this.session.get('app_visits', 0) + 1)
return html(`
<h1>Welcome to Extollo!</h1>
<h2>You have visited this page ${this.session.get('app_visits')} times.</h2>
`)
} }
} }

@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es6",
"module": "commonjs", "module": "commonjs",
"declaration": true, "declaration": true,
"outDir": "./lib", "outDir": "./lib",

Loading…
Cancel
Save