helmet improvements; rearrange index.html

This commit is contained in:
Josh Harvey 2016-12-21 03:53:41 +02:00
parent 7a333fe62e
commit 99b19cffc2
2 changed files with 11 additions and 7 deletions

View file

@ -12,6 +12,7 @@ const cookieParser = require('cookie-parser')
const argv = require('minimist')(process.argv.slice(2)) const argv = require('minimist')(process.argv.slice(2))
const got = require('got') const got = require('got')
const morgan = require('morgan') const morgan = require('morgan')
const helmet = require('helmet')
const accounts = require('../lib/admin/accounts') const accounts = require('../lib/admin/accounts')
const machines = require('../lib/admin/machines') const machines = require('../lib/admin/machines')
@ -55,6 +56,9 @@ function dbNotify () {
const skip = (req, res) => req.path === '/api/status/' && res.statusCode === 200 const skip = (req, res) => req.path === '/api/status/' && res.statusCode === 200
app.use(morgan('dev', {skip})) app.use(morgan('dev', {skip}))
app.use(helmet({
noCache: true
}))
app.use(cookieParser()) app.use(cookieParser())
app.use(register) app.use(register)
// if (!devMode) app.use(authenticate) // if (!devMode) app.use(authenticate)

View file

@ -1,17 +1,12 @@
<html> <html>
<head> <head>
<base href="/"> <base href="/">
</head> <link rel="stylesheet" href="bower_components/gridism/gridism.css">
<body> <link rel="stylesheet" href="styles.css">
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script> <script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<script src="bower_components/qrjs/qr.js"></script> <script src="bower_components/qrjs/qr.js"></script>
<script src="bower_components/qr-code/src/qr-code.js"></script> <script src="bower_components/qr-code/src/qr-code.js"></script>
<script src="elm.js"></script> <script src="elm.js"></script>
<script>
Elm.Main.fullscreen()
</script>
<link rel="stylesheet" href="bower_components/gridism/gridism.css">
<link rel="stylesheet" href="styles.css">
<style> <style>
@keyframes fadein { @keyframes fadein {
from { opacity: 0; } from { opacity: 0; }
@ -28,5 +23,10 @@
} }
</style> </style>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<script>
Elm.Main.fullscreen()
</script>
</body> </body>
</html> </html>