Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

prepare for new server. Closes #65 #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node_modules
.DS_Store
node_modules
log/*
!log/.gitkeep
24 changes: 0 additions & 24 deletions config/LaunchDaemons/com.chachachat.chachachat.plist

This file was deleted.

17 changes: 17 additions & 0 deletions ecosystem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"apps" : [
{
"name": "chachachat",
"script": "server.js",
"instances": 1,
"cwd": ((process.env.NODE_ENV === "production") ? "" : "/Users/" + process.env.USER) + "/chachachat/",
"max_memory_restart": "512M",
"log_file": ((process.env.NODE_ENV === "production") ? "" : "/Users/" + process.env.USER) + "/chachachat/log/chachachat.log",
"out_file": "/dev/null",
"error_file": ((process.env.NODE_ENV === "production") ? "" : "/Users/" + process.env.USER) + "/chachachat/log/err.log",
"log_date_format": "YYYY-MM-DD HH:mm Z",
"merge_logs": true,
"watch": false
}
]
}
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
"start": "node server.js"
},
"dependencies": {
"express": "3.5.0",
"express-session": "latest",
"mongoose": "~3.8.22",
"socket.io": "0.9.14",
"passport": "0.2.0",
"apn": "1.7.8",
"async": "2.5.0",
"connect-redis": "2.5.1",
"express": "3.21.2",
"express-session": "1.15.3",
"jade": "1.11.0",
"mongoose": "3.8.40",
"passport": "0.3.2",
"passport-local": "1.0.0",
"jade": "1.3.1",
"connect-redis": "2.0.0",
"passport.socketio": "3.0.1",
"winston": "0.7.3",
"underscore": "1.6.0",
"async": "0.9.0",
"apn": "latest"
"passport.socketio": "3.7.0",
"socket.io": "0.9.19",
"underscore": "1.8.3",
"winston": "1.1.2"
},
"devDependencies": {
"debug" : "latest"
"debug": "latest"
},
"repository": {
"type": "git",
Expand Down
19 changes: 2 additions & 17 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,30 +209,15 @@ app.post('/register', function(req, res, next) {
});
});


var server;
if (app.get('env') === 'production') {

debugger

server = http.createServer(app);
} else {
var credentials = {
key: fs.readFileSync('config/chachachat-key.pem'),
cert: fs.readFileSync('config/chachachat-cert.pem')
};
server = https.createServer(credentials, app); // to be able to test local;
}


var server = http.createServer(app);
var io = socketio.listen(server);

io.set('authorization', passportSocketIO.authorize({
cookieParser: express.cookieParser,
key: 'connect.sid',
secret: sessionSecret,
store: sessionStore
}));

app.io = io;

// Bootstrap controllers
Expand Down
5 changes: 0 additions & 5 deletions start_local.sh

This file was deleted.

7 changes: 0 additions & 7 deletions start_production.sh

This file was deleted.