candyapple
v0.0.1-beta1
Published
A sweet Express templating engine with a WASM core
Downloads
2
Readme
A sweet Express templating engine with a WASM core.
About
Candy Apple is a templating language and engine designed to be used with the Express web framework. Candy Apple depends heavily on Grotto, a Rust WASM core for manipulating pure data functionally.
🚴 Usage
npm i candyapple
Then add it as an Express view engine
const {engine} = require('candyapple')
const express = require('express')
const app = express()
const port = 3030
app.engine('html', engine);
app.set('views', './examples')
app.set('view engine', 'html')
app.get('/', (req, res) => {
try {
res.render('index', { title: "Grotto!" })
} catch (e) {
console.error(e);
}
})
app.get('/test', (req, res) => {
res.send('hi')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})