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
text/typescript
import { Controller, get, inject, params } from 'zents'
import ClockService from '../service/ClockService'
export default class extends Controller {
protected clock: ClockService
('/')
public async index() {
return await this.render('index', {
now: this.clock.now(),
})
}
('/hello/:name')
public async helloWorld( params: { name: string }) {
const greetings = `Hello ${params.name}`
return await this.render('hello', {
greetings,
})
}
}