mirror of
https://github.com/cupcakearmy/cometa.git
synced 2025-03-12 14:27:28 +00:00
Express Example
This commit is contained in:
parent
c37f82b27e
commit
aed6be6dc9
20
examples/express/app.js
Normal file
20
examples/express/app.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import * as express from 'express'
|
||||||
|
|
||||||
|
const app = express()
|
||||||
|
|
||||||
|
app.set('views', './views')
|
||||||
|
app.set('view engine', 'blitz')
|
||||||
|
app.engine('blitz', require('./src/blitz')._express)
|
||||||
|
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.render('new', {
|
||||||
|
myVar: 'whuup whuup',
|
||||||
|
arr: [{
|
||||||
|
test: true
|
||||||
|
}, {
|
||||||
|
test: false
|
||||||
|
}],
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
app.listen(3000, () => console.log('Example app listening on port 3000!'))
|
6
examples/express/package.json
Normal file
6
examples/express/package.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"@types/express": "^4.11.1",
|
||||||
|
"express": "^4.16.2"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user