Skip to content

Commit 6ed5fad

Browse files
author
Slinto
committed
Babel - backend
1 parent 02e76d4 commit 6ed5fad

12 files changed

Lines changed: 39 additions & 334 deletions

File tree

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: node server/app.js
1+
web: babel-node server/app.js

build/css/app.css

Lines changed: 1 addition & 282 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/css/basic.styl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ body
66
height 100%
77
font-weight 400
88
color $black
9-
background #f5f5f5
9+
background $ligthGrey
1010
font-size 14px
1111
text-rendering optimizelegibility
1212
-webkit-font-smoothing antialiased
1313
padding 20px
1414

1515
::selection
16-
background $pink
17-
color #FFF
16+
background $grey
17+
color $ligthGrey
1818

1919
a
20-
color #e74c3c
20+
color $red
2121
text-decoration none

client/css/variables.styl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
* Variables file.
33
*/
44

5-
// Colors
6-
$blue = #0083e9
75
$grey = #37474f
6+
$ligthGrey = #f5f5f5
7+
$red = #e74c3c

gulpfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ gulp.task('build', function() {
142142
gulp.task('release', function() {
143143
VERSION = args.v || args.version;
144144

145-
if (typeof VERSION !== 'undefined') {
145+
if (typeof VbaERSION !== 'undefined') {
146146
runSequence('clean', 'stylus', 'test', 'webpack', 'imagemin', 'bump', 'git-commit', 'git-push');
147147
} else {
148148
console.log('SORRY, app --version parameter missing.');
@@ -152,11 +152,12 @@ gulp.task('release', function() {
152152
gulp.task('start-server', function() {
153153
nodemon({
154154
script: 'server/app.js',
155+
exec: 'babel-node',
155156
watch: ['server/**/*.js']
156157
}).on('start');
157158

158159
livereload.listen();
159-
gulp.watch(['client/css/**/*.styl'], ['stylus', 'minify-css']);
160+
gulp.watch(['client/css/**/*.styl'], ['stylus']);
160161
gulp.watch(['client/js/**/*.js', '!./client/js/bower_components/**/*.js', '!/client/js/build.js'], ['webpack']);
161162
gulp.watch(['test/**/*.js'], ['test']);
162163
gulp.watch(['build/css/app.css', 'build/img/**', 'server/views/**/*.jade']).on('change', livereload.changed);

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"url": "https://github.com/slinto/slinto-devstack.git"
99
},
1010
"scripts": {
11-
"start": "node server/app.js",
11+
"start": "babel-node server/app.js",
1212
"test": "gulp test-deployed"
1313
},
1414
"engines": {
1515
"node": "0.12.x"
1616
},
1717
"dependencies": {
18+
"babel": "^5.8.23",
1819
"body-parser": "^1.13.3",
1920
"compression": "^1.5.2",
2021
"connect-flash": "^0.1.1",
@@ -25,11 +26,10 @@
2526
"jade": "^1.11.0",
2627
"method-override": "^2.3.5",
2728
"mongoose": "^4.1.0",
28-
"pretty-error": "^1.1.2",
29+
"pretty-error": "^1.2.0",
2930
"serve-favicon": "^2.3.0"
3031
},
3132
"devDependencies": {
32-
"babel-core": "^5.8.23",
3333
"babel-loader": "^5.3.2",
3434
"gulp": "^3.9.0",
3535
"gulp-autoprefixer": "^2.3.1",

server/app.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
/**
22
* Main app start point.
33
*/
4-
var express = require('express');
5-
prettyError = require('pretty-error').start();
4+
import express from 'express';
5+
const app = express();
66

7-
var app = express();
8-
9-
prettyError.skipNodeFiles();
10-
prettyError.skipPackage('express');
11-
12-
var config = require('./config'),
13-
error = require('./lib/error_handler');
7+
import * as config from './config';
8+
import * as error from './lib/error_handler';
149

1510
config.appSetup(app);
1611
//config.dbConnect();
1712
error.setup(app);
18-
app.listen(config.port, function() {
13+
14+
app.listen(config.port, () => {
1915
console.log('Listening on port %d', config.port);
2016
});

0 commit comments

Comments
 (0)