reviving pug
This commit is contained in:
parent
8d05e71359
commit
f11d98e7e3
6 changed files with 13 additions and 21 deletions
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Crafty Things</title>
|
||||
<script src="game.bundle.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
|
@ -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'
|
||||
|
|
|
@ -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
6
views/game.pug
Normal file
|
@ -0,0 +1,6 @@
|
|||
doctype html
|
||||
html
|
||||
head
|
||||
title Crafty Things
|
||||
script(src='/game.bundle.js')
|
||||
body
|
|
@ -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!
|
Reference in a new issue