Skip to content

Commit

Permalink
babel
Browse files Browse the repository at this point in the history
  • Loading branch information
gsellator committed Apr 22, 2016
1 parent affa9f9 commit 1cf6b37
Show file tree
Hide file tree
Showing 45 changed files with 70 additions and 256 deletions.
3 changes: 3 additions & 0 deletions .babelrc
@@ -0,0 +1,3 @@
{
"optional": ["es7.classProperties"]
}
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

6 changes: 2 additions & 4 deletions .gitignore
@@ -1,5 +1,3 @@
pkg
*.DS_Store
node_modules
public/components
config/Secret.js
Secret.md
npm-debug.log
144 changes: 0 additions & 144 deletions Gruntfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion Procfile
@@ -1 +1 @@
web: node app.js
web: node main.js
5 changes: 5 additions & 0 deletions index.js
@@ -0,0 +1,5 @@
// Register babel to have ES6 support on the server
require("babel-core/register");

// Start the server app
require("./src/server");
30 changes: 30 additions & 0 deletions main.js
@@ -0,0 +1,30 @@
var pm2 = require('pm2');

var instances = process.env.WEB_CONCURRENCY || -1;
var maxMemory = process.env.WEB_MEMORY || 512;

pm2.connect(function() {
  pm2.start({
    script    : 'index.js',
    exec_mode : 'cluster',
    instances : instances,
    max_memory_restart : maxMemory + 'M'   // Auto restart if process taking more than XXmo
  }, function(err) {
    if (err) return console.error('Error while launching applications', err.stack || err);
    console.log('PM2 and application has been succesfully started');

    // Display logs in standard output
    pm2.launchBus(function(err, bus) {
      console.log('[PM2] Log streaming started');

      bus.on('log:out', function(packet) {
       console.log('[App:%s] %s', packet.process.name, packet.data);
      });

      bus.on('log:err', function(packet) {
        console.error('[App:%s][Err] %s', packet.process.name, packet.data);
      });
    });

  });
});
20 changes: 6 additions & 14 deletions package.json
Expand Up @@ -25,28 +25,20 @@
"dev": "DEBUG=hub node index"
},
"dependencies": {
"babel": "^6.3.26",
"babel-core": "^5.8.33",
"bcrypt": "^0.8.5",
"body-parser": "^1.14.2",
"bower": "^1.7.7",
"compression": "^1.6.1",
"debug": "^2.2.0",
"ejs": "^2.4.1",
"express": "^4.13.4",
"grunt-contrib-sass": "^0.9.2",
"kerberos": "0.0.17",
"mongoose": "^4.4.2",
"pm2": "^0.15.10",
"q": "^1.4.1",
"serve-favicon": "^2.3.0",
"slack-client": "^1.5.1"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-bump": "^0.7.0",
"grunt-concurrent": "^2.1.0",
"grunt-contrib-clean": "^0.7.0",
"grunt-contrib-copy": "^0.8.2",
"grunt-contrib-imagemin": "^1.0.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-nodemon": "^0.4.1",
"grunt-sftp-deploy": "^0.2.4",
"open": "0.0.5",
"time-grunt": "^1.3.0"
}
}
24 changes: 0 additions & 24 deletions sh/prod/deploy.sh

This file was deleted.

18 changes: 0 additions & 18 deletions sh/prod/nginx.conf

This file was deleted.

31 changes: 0 additions & 31 deletions sh/prod/start.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 23 additions & 17 deletions app.js → src/server.js
@@ -1,20 +1,26 @@
var config = require('./config/config'),
auth = require('./helpers/auth'),
billSharing = require('./helpers/billSharing'),
expense = require('./helpers/expense'),
initializer = require('./helpers/initializer'),
member = require('./helpers/member'),
adminCtrl = require('./controllers/admin'),
loginCtrl = require('./controllers/login');

var express = require('express'),
bodyParser = require('body-parser'),
compression = require('compression'),
path = require('path'),
mongoose = require('mongoose'),
Slack = require('slack-client'),
fs = require('fs'),
q = require('q');
import path from "path";
import express from "express";
import compression from "compression";
import bodyParser from "body-parser";
//import cookieParser from "cookie-parser";
//import favicon from "serve-favicon";
//import morgan from "morgan";
import mongoose from "mongoose";
import Slack from "Slack";
import fs from "fs";
import q from "q";
import config from "./config/config";

import AppsCtrl from "./controllers/AppsCtrl";
import auth from "./helpers/auth";
import billSharing from "./helpers/billSharing";
import expense from "./helpers/expense";
import initializer from "./helpers/initializer";
import member from "./helpers/member";
import adminCtrl from "./controllers/admin";
import loginCtrl from "./controllers/login";

const debug = require("debug")("bot");

var app = express();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1cf6b37

Please sign in to comment.