UNPKG

zents-cli

Version:

ZenTS is a Node.js & TypeScript MVC-Framework for building rich web applications, released as free and open-source software under the MIT License. It is designed for building web applications with modern tools and design patterns.

25 lines (19 loc) 513 B
import { Controller, get, inject, params } from 'zents' import ClockService from '../service/ClockService' export default class extends Controller { @inject protected clock: ClockService @get('/') public async index() { return await this.render('index', { now: this.clock.now(), }) } @get('/hello/:name') public async helloWorld(@params params: { name: string }) { const greetings = `Hello ${params.name}` return await this.render('hello', { greetings, }) } }