Add svelte as a view engine to swaf #33
@ -137,6 +137,9 @@ export default class TestApp extends Application {
|
||||
this.get('/', (req, res) => {
|
||||
res.render('home');
|
||||
}, 'home');
|
||||
this.get('/tests', (req, res) => {
|
||||
res.render('tests');
|
||||
}, 'tests');
|
||||
}
|
||||
}());
|
||||
}
|
||||
|
@ -1,10 +1,17 @@
|
||||
<script lang="ts">
|
||||
import AllTests from "./AllTests.svelte";
|
||||
import {locals} from "../ts/stores";
|
||||
import {route} from "../../common/Routing";
|
||||
import BaseLayout from "./layouts/BaseLayout.svelte";
|
||||
|
||||
let test: string = 'testing';
|
||||
</script>
|
||||
|
||||
<BaseLayout title="Home tests">
|
||||
<AllTests/>
|
||||
<BaseLayout title="{$locals.app.name}">
|
||||
<div class="panel">
|
||||
<p>Welcome to {$locals.app.name}!</p>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href={route('tests')}>Frontend tests</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</BaseLayout>
|
||||
|
8
src/assets/views/tests.svelte
Normal file
8
src/assets/views/tests.svelte
Normal file
@ -0,0 +1,8 @@
|
||||
<script lang="ts">
|
||||
import AllTests from "./AllTests.svelte";
|
||||
import BaseLayout from "./layouts/BaseLayout.svelte";
|
||||
</script>
|
||||
|
||||
<BaseLayout title="Frontend tests">
|
||||
<AllTests/>
|
||||
</BaseLayout>
|
Loading…
Reference in New Issue
Block a user