Created
October 13, 2015 20:02
-
-
Save WowSuchRicky/bfa3768befac30eb1000 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created with JetBrains WebStorm. | |
| * User: Ricky | |
| * Date: 7/31/13 | |
| * Time: 10:17 PM | |
| * To change this template use File | Settings | File Templates. | |
| */ | |
| require('newrelic'); | |
| var express = require('express'), | |
| http = require('http'), | |
| port = Math.floor(process.argv[2]) || process.env.PORT || 1337, //rudimentary integer check | |
| app = express(), | |
| server = app.listen(port), | |
| io = require('socket.io').listen(server); | |
| /* FOR ANGULAR ROUTING vvvv */ | |
| app.use(express.static(__dirname + "/public")); | |
| app.all('/*', function(req, res) { | |
| res.sendfile('public/index.html'); | |
| }); | |
| /* FOR REGULAR EXPRESS ROUTING */ | |
| //app.use(app.router); | |
| //app.use(function(req, res) { | |
| // // Use res.sendfile, as it streams instead of reading the file into memory. | |
| // res.sendfile(__dirname + '/public/index.html'); | |
| //}); | |
| io.sockets.on("connection", function (socket) { | |
| "use strict"; | |
| console.log("Socket initialized"); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment