Support deno 1.3.x/0.67.0; replace handlebars with view_engine library
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import Controller from '../../../lib/src/http/Controller.ts'
|
||||
import {Request} from '../../../lib/src/http/Request.ts'
|
||||
import {view} from '../../../lib/src/http/response/helpers.ts'
|
||||
import {Injectable} from '../../../di/module.ts'
|
||||
|
||||
@Injectable()
|
||||
export default class HomeController extends Controller {
|
||||
|
||||
get_home(request: Request) {
|
||||
return view('home', { request })
|
||||
async get_home(request: Request) {
|
||||
return view('home', { greeting: 'Hello' })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
<h1>Welcome to Daton!</h1>
|
||||
<html>
|
||||
{{> header }}
|
||||
<body>
|
||||
<h1>{{ greeting }} from Daton!</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{{#if title}}
|
||||
<title>{{ title }} | Daton</title>
|
||||
{{else}}
|
||||
<title>Daton</title>
|
||||
{{/if}}
|
||||
</head>
|
||||
<body>
|
||||
{{{ body }}}
|
||||
</body>
|
||||
</html>
|
||||
3
app/http/views/partials/header.hbs
Normal file
3
app/http/views/partials/header.hbs
Normal file
@@ -0,0 +1,3 @@
|
||||
<head>
|
||||
<title>Daton</title>
|
||||
</head>
|
||||
Reference in New Issue
Block a user