Enable caching for bundle, also bundle socket.io

pull/108/head
Candid Dauth 2017-02-09 20:13:45 +01:00
rodzic 8040f01ed7
commit c85066b618
5 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -1,3 +1,4 @@
import io from 'socket.io-client';
import fm from '../app';
import $ from 'jquery';

Wyświetl plik

@ -39,7 +39,5 @@
};
})();
</script>
<script src="socket.io/socket.io.js"></script>
</body>
</html>

Wyświetl plik

@ -43,6 +43,7 @@
"request-promise": "^4.1.1",
"sequelize": "^3.24.3",
"socket.io": "^1.2.1",
"socket.io-client": "^1.7.2",
"stream-combiner": "^0.2.2",
"underscore": "^1.8.3"
},

Wyświetl plik

@ -37,6 +37,13 @@ utils.promiseAuto({
server: () => {
var app = express();
app.use(compression());
app.get("/bundle-:hash.js", function(req, res, next) {
res.setHeader('Cache-Control', 'public, max-age=31557600'); // one year
next();
});
app.use(express.static(frontendPath + "/build/"));
app.get("/:padId", function(req, res) {
res.sendFile(frontendPath + "/build/index.html");

Wyświetl plik

@ -4563,7 +4563,7 @@ socket.io-adapter@0.5.0:
debug "2.3.3"
socket.io-parser "2.3.1"
socket.io-client@1.7.2:
socket.io-client@1.7.2, socket.io-client@^1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-1.7.2.tgz#39fdb0c3dd450e321b7e40cfd83612ec533dd644"
dependencies: