reviving pug

This commit is contained in:
Jörn-Michael Miehe 2018-11-29 14:47:18 +01:00
parent 8d05e71359
commit f11d98e7e3
6 changed files with 13 additions and 21 deletions

View file

@ -45,6 +45,7 @@
"express": "^4.16.4",
"helmet": "^3.15.0",
"mysql": "^2.16.0",
"pug": "^2.0.3",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0"
}

View file

@ -1,8 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Crafty Things</title>
<script src="game.bundle.js"></script>
</head>
<body></body>
</html>

View file

@ -22,6 +22,11 @@ app.use helmet()
# Static content
app.use express.static path.resolve(__dirname, 'public_html')
# Templates
app.set 'view engine', 'pug'
app.get '/:template.html', (req, res) ->
res.render (req.params.template + '.pug')
con = mysql.createConnection
host: 'tcgsql'
user: 'fftcg'

View file

@ -1,9 +0,0 @@
doctype html
html
head
title Crafty Things
link(rel='stylesheet', href='style.css')
script(src='/socket.io/socket.io.js')
script(src='lib.min.js')
script(src='game.min.js')
body

6
views/game.pug Normal file
View file

@ -0,0 +1,6 @@
doctype html
html
head
title Crafty Things
script(src='/game.bundle.js')
body

View file

@ -2,10 +2,7 @@ doctype html
html
head
title Crafty Things
link(rel='stylesheet', href='style.css')
script(src='/socket.io/socket.io.js')
script(src='lib.min.js')
script(src='index.min.js')
script(src='/index.bundle.js')
body
h1 Hello World!
h2 App under development, please don't send valuable data!