Skip to content
Create a gist now

Instantly share code, notes, and snippets.

description of edits to enhance server.js for node-boilerplate
<script>SOCKET_IO_PORT = <%= port %>;</script>
<script src="/js/"></script>
<!-- Change UA-XXXXX-X to be your site's ID -->
var _gaq=[["_setAccount","<%= googleAnalyticsSiteId %>"],["_trackPageview"]];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
socket = new io.Socket(null, {
,transports: ['websocket', 'htmlfile', 'xhr-multipart', 'xhr-polling']
,path: '/client/'
// at the top of the file, or in a site config file:
var googleAnalyticsSiteId = 'UA-XXXXX-X';
// THREE PLACES: 404, 500, index, etc. Consider using a default "locals" object that is extended for each instance.
res.render('VARIOUS TEMPLATES', {locals: {
googleAnalyticsSiteId: googleAnalyticsSiteId,
port: port // only needed for the index.ejs route
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.