Add svelte as a view engine to swaf #33

Merged
ashpie merged 97 commits from svelte into develop 2021-11-09 19:31:22 +01:00
3 changed files with 23 additions and 5 deletions
Showing only changes of commit f1ae6f6a7b - Show all commits

View File

@ -137,6 +137,9 @@ export default class TestApp extends Application {
this.get('/', (req, res) => { this.get('/', (req, res) => {
res.render('home'); res.render('home');
}, 'home'); }, 'home');
this.get('/tests', (req, res) => {
res.render('tests');
}, 'tests');
} }
}()); }());
} }

View File

@ -1,10 +1,17 @@
<script lang="ts"> <script lang="ts">
import AllTests from "./AllTests.svelte"; import {locals} from "../ts/stores";
import {route} from "../../common/Routing";
import BaseLayout from "./layouts/BaseLayout.svelte"; import BaseLayout from "./layouts/BaseLayout.svelte";
let test: string = 'testing';
</script> </script>
<BaseLayout title="Home tests"> <BaseLayout title="{$locals.app.name}">
<AllTests/> <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> </BaseLayout>

View 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>