dont know what happened
This commit is contained in:
17
server/config/controllers.js
Normal file
17
server/config/controllers.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import fs from 'fs';
|
||||
|
||||
const CONTROLLER_DIR = __dirname + '/../controllers';
|
||||
|
||||
class Controllers {
|
||||
|
||||
static sync(){
|
||||
fs.readdirSync(CONTROLLER_DIR).forEach(function(file) {
|
||||
var controller = require(CONTROLLER_DIR + '/' + file);
|
||||
Controllers[controller.NAME] = controller;
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Controllers;
|
||||
37
server/config/database.js
Normal file
37
server/config/database.js
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
|
||||
import fs from "fs";
|
||||
import Sequelize from 'sequelize';
|
||||
|
||||
var sequelize = new Sequelize("postgres://spikeuser:123456@localhost:5432/spike2", {
|
||||
pool: {
|
||||
max: 5,
|
||||
min: 0,
|
||||
idle: 10000
|
||||
}
|
||||
});
|
||||
const MODEL_DIR = __dirname + '/../models'
|
||||
|
||||
class Database {
|
||||
|
||||
static sync(){
|
||||
console.log("syncing db")
|
||||
fs.readdirSync(MODEL_DIR).forEach(function(file) {
|
||||
var model = require(MODEL_DIR + '/' + file);
|
||||
Database[model.NAME] = model;
|
||||
Database.models.push(model);
|
||||
});
|
||||
|
||||
// add associations
|
||||
for (var model of Database.models){
|
||||
model.set();
|
||||
}
|
||||
|
||||
return sequelize.sync().then(()=>{ console.log("done syncing db") });
|
||||
}
|
||||
}
|
||||
Database.sequelize = sequelize;
|
||||
Database.Sequelize = Sequelize;
|
||||
Database.models = [];
|
||||
|
||||
export default Database;
|
||||
7
server/config/react_templates.js
Normal file
7
server/config/react_templates.js
Normal file
@@ -0,0 +1,7 @@
|
||||
var config = {
|
||||
modules: 'es6',
|
||||
targetVersion: '0.14.0',
|
||||
suffix: '.rt'
|
||||
};
|
||||
|
||||
export default config;
|
||||
1
server/config/webpack/design.js
Normal file
1
server/config/webpack/design.js
Normal file
@@ -0,0 +1 @@
|
||||
design.js
|
||||
48
server/config/webpack/development.js
Normal file
48
server/config/webpack/development.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import webpack from 'webpack';
|
||||
|
||||
const ROOT = __dirname + '/../../../';
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: ROOT + 'client/app',
|
||||
style: ROOT + 'client/style'
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: ROOT + 'client/build/development'
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.scss$/,
|
||||
loaders: ['style', 'raw', 'sass']
|
||||
}, {
|
||||
test: /\.css$/,
|
||||
loaders: ['style', 'raw']
|
||||
}, {
|
||||
test: /\.js$/,
|
||||
loader: 'babel'
|
||||
}, {
|
||||
test: /\.json$/,
|
||||
loader: 'json-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
sassLoader: {
|
||||
includePaths: [ROOT + 'client', ROOT + 'node_modules']
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
$: "jquery",
|
||||
jQuery: "jquery",
|
||||
"window.jQuery": "jquery"
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
d3: "d3",
|
||||
"window.d3": "d3"
|
||||
})
|
||||
],
|
||||
node: {
|
||||
fs: "empty"
|
||||
}
|
||||
}
|
||||
58
server/config/webpack/production.js
Normal file
58
server/config/webpack/production.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import ExtractTextPlugin from 'extract-text-webpack-plugin';
|
||||
import webpack from 'webpack';
|
||||
|
||||
const ROOT = __dirname + '/../../../';
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: ROOT + 'client/app',
|
||||
style: ROOT + 'client/style'
|
||||
},
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
filename: '[name].min.js',
|
||||
path: ROOT + 'client/build/production'
|
||||
},
|
||||
externals: {
|
||||
jquery: "$",
|
||||
d3: "d3"
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.scss$/,
|
||||
loader: ExtractTextPlugin.extract("style-loader", "raw-loader!sass-loader")
|
||||
}, {
|
||||
test: /\.css$/,
|
||||
loader: ExtractTextPlugin.extract("style-loader", "raw-loader")
|
||||
}, {
|
||||
test: /\.js$/,
|
||||
loader: 'babel'
|
||||
}, {
|
||||
test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||
loader: "url-loader?limit=10000&minetype=application/font-woff"
|
||||
}, {
|
||||
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||
loader: "file-loader"
|
||||
}
|
||||
]
|
||||
},
|
||||
sassLoader: {
|
||||
includePaths: [ROOT + 'client', ROOT + 'node_modules']
|
||||
},
|
||||
// Use the plugin to specify the resulting filename (and add needed behavior to the compiler)
|
||||
plugins: [
|
||||
new ExtractTextPlugin("style.min.css", {
|
||||
allChunks: true
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({minimize: true}),
|
||||
new webpack.ProvidePlugin({
|
||||
$: "jquery",
|
||||
jQuery: "jquery",
|
||||
"window.jQuery": "jquery"
|
||||
})
|
||||
],
|
||||
node: {
|
||||
fs: "empty"
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user