Correctly configure client transports

Fixes #848
This commit is contained in:
Pavel Djundik 2017-06-01 22:43:23 +03:00
parent 1f1b025b81
commit 16fb118d02
3 changed files with 8 additions and 2 deletions

View file

@ -25,7 +25,7 @@
<meta name="theme-color" content="#455164">
</head>
<body class="signed-out {{#if public}}public{{/if}}">
<body class="signed-out {{#if public}}public{{/if}}" data-transports="{{tojson transports}}">
<div id="wrap">
<div id="viewport">

View file

@ -5,6 +5,7 @@ const io = require("socket.io-client");
const path = window.location.pathname + "socket.io/";
const socket = io({
transports: $(document.body).data("transports"),
path: path,
autoConnect: false,
reconnection: false

View file

@ -32,7 +32,12 @@ module.exports = function() {
.use(allRequests)
.use(index)
.use(express.static("client"))
.engine("html", expressHandlebars({extname: ".html"}))
.engine("html", expressHandlebars({
extname: ".html",
helpers: {
tojson: c => JSON.stringify(c)
}
}))
.set("view engine", "html")
.set("views", path.join(__dirname, "..", "client"));