mirror of
https://github.com/cupcakearmy/cometa.git
synced 2025-03-12 14:27:28 +00:00
Simple Example
This commit is contained in:
parent
5f571406c7
commit
0115cb7d97
@ -0,0 +1,15 @@
|
||||
const Cometa = require('../../dist/cometa.js')
|
||||
const cometa = new Cometa()
|
||||
|
||||
const template = 'index'
|
||||
const data = {
|
||||
name: 'World'
|
||||
}
|
||||
const callback = (err, html) => {
|
||||
if (err)
|
||||
console.log(err)
|
||||
else
|
||||
console.log(html)
|
||||
}
|
||||
|
||||
cometa.renderTemplate(template, data, callback)
|
3
examples/simple/package.json
Normal file
3
examples/simple/package.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"dependencies": {}
|
||||
}
|
1
examples/simple/views/index.html
Normal file
1
examples/simple/views/index.html
Normal file
@ -0,0 +1 @@
|
||||
Hello {{name}}!
|
Loading…
x
Reference in New Issue
Block a user