Comments (2)
There is an example: https://github.com/spirit-js/examples#rendering-templates-with-jade
Is that ok? If it is not clear, let me know why so I can update the example or show more examples?
A template ends up being a string, so you just return the string. And the template libraries have their own compiling function that you can use.
Only complicated part is having caching, but that really depends on what you want the cache to do.
Also other libraries exist for working with different templates https://github.com/tj/consolidate.js
Maybe I can show an example using that.
from spirit.
An example using consolidate would be great since it would cover several templating engines at the same time.
from spirit.
Related Issues (18)
- Return JSON response with custom status code HOT 5
- A possible error in request documentation HOT 1
- HTTP 2 support HOT 5
- Question: How is the API of Spirit better than koa2? HOT 3
- Typescript definitions HOT 2
- Why did you not include the package-lock.json ? HOT 3
- Versus Fastify HOT 2
- Remaining work that still need to be done
- Feature Request: Support for Koa Middleware HOT 2
- Response Headers Get Unexpectedly Modified
- gsap not found in Angular project HOT 1
- support http range requests
- Feature request. URL reversing function HOT 6
- Feature request: locals injection example for template engines HOT 1
- Any ETA for RC version? HOT 6
- optimise your .npmignore HOT 1
- Body parsing HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spirit.