2018-02-07 11:57:20 +01:00
|
|
|
const express = require('express')
|
2018-02-07 11:41:24 +01:00
|
|
|
const app = express()
|
2018-02-09 15:00:30 +01:00
|
|
|
const Cometa = require('../../dist/cometa')
|
2018-02-07 11:41:24 +01:00
|
|
|
|
|
|
|
app.set('views', './views')
|
2018-02-09 15:00:30 +01:00
|
|
|
app.set('view engine', 'html')
|
|
|
|
app.engine('html', new Cometa()._express)
|
2018-02-07 11:41:24 +01:00
|
|
|
|
|
|
|
app.get('/', (req, res) => {
|
2018-02-07 11:57:20 +01:00
|
|
|
res.render('index', {
|
|
|
|
title: 'Cometa!',
|
2018-02-07 11:41:24 +01:00
|
|
|
arr: [{
|
2018-02-07 11:57:20 +01:00
|
|
|
show: true,
|
|
|
|
msg: 'Show meee',
|
2018-02-07 11:41:24 +01:00
|
|
|
}, {
|
2018-02-07 11:57:20 +01:00
|
|
|
show: false,
|
|
|
|
msg: 'I\'m hidden :(',
|
2018-02-07 11:41:24 +01:00
|
|
|
}],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
app.listen(3000, () => console.log('Example app listening on port 3000!'))
|