Skip to content

Commit

Permalink
Merge pull request #1385 from kunjee17/spin_tera
Browse files Browse the repository at this point in the history
Updating Spin Hub with Tera Sample
  • Loading branch information
itowlson authored Sep 19, 2024
2 parents 21356b1 + ed6c2ff commit 5275784
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 5275784

Please sign in to comment.