Skip to content

Commit

Permalink
Updating Spin Hub with Tera Sample
Browse files Browse the repository at this point in the history
Signed-off-by: Kunjan Dalal <[email protected]>
  • Loading branch information
kunjee17 committed Sep 18, 2024
1 parent 21356b1 commit ed6c2ff
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions content/api/hub/sample_tera.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title = "Tera Template Engine and Spin"
template = "render_hub_content_body"
date = "2024-09-17T00:00:00Z"
content-type = "text/html"
tags = ["rust", "templating" , "cookies"]

[extra]
author = "kunjee17"
type = "hub_document"
category = "Sample"
language = "Rust"
created_at = "2024-09-17T00:00:00Z"
last_updated = "2024-09-17T00:00:00Z"
spin_version = ">=v2.0"
summary = "Example of how to load templates off of the filesystem and then render them. Also, covers creating session cookies and protected routes using cookies."
url = "https://github.com/kunjee17/spin_monolith"
keywords = "rust, tera, cookies"

---

This is an example of using the [Tera template engine](https://keats.github.io/tera/) inside of a Fermyon Spin app. You will learn how to load templates off of the filesystem and then render them.

Also, you will learn how to use session cookies to have protected route and how to use `form-post` to submit data to spin route.

To get started, please visit the [GitHub repository](https://github.com/kunjee17/spin_monolith).

0 comments on commit ed6c2ff

Please sign in to comment.