kopia lustrzana https://github.com/FacilMap/facilmap
Enable caching for bundle, also bundle socket.io
rodzic
8040f01ed7
commit
c85066b618
|
@ -1,3 +1,4 @@
|
|||
import io from 'socket.io-client';
|
||||
import fm from '../app';
|
||||
import $ from 'jquery';
|
||||
|
||||
|
|
|
@ -39,7 +39,5 @@
|
|||
};
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script src="socket.io/socket.io.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue