├── .eslintrc ├── .gitattributes ├── .gitignore ├── app.js ├── gulpfile.js ├── index.html ├── js └── test.js ├── less ├── base.less └── reset.less └── package.json /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": false, 4 | "node": true, 5 | "es6": true 6 | }, 7 | "rules": { 8 | "no-debugger": 1, // disallow use of debugger 9 | "no-unused-vars": 1, // disallow declaration of variables that are not used in the code 10 | "no-var": 2, // require let or const instead of var 11 | "semi": 2 // require semicolons 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Production 7 | dist 8 | 9 | # Coverage directory used by tools like istanbul 10 | coverage 11 | 12 | # node-waf configuration 13 | .lock-wscript 14 | 15 | # Compiled binary addons (http://nodejs.org/api/addons.html) 16 | build/Release 17 | 18 | # Dependency directories 19 | node_modules 20 | jspm_packages 21 | 22 | # Optional npm cache directory 23 | .npm 24 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const express = require("express"); 4 | const app = express(); 5 | 6 | // Static css/js files 7 | app.use('/static', express.static('./dist')); 8 | 9 | app.get("/", function(req, res) { 10 | res.sendFile( __dirname + '/index.html'); 11 | }); 12 | 13 | 14 | const port = 3001; 15 | 16 | // Start server 17 | app.listen(port, function() { 18 | console.log("Listening on " + port); 19 | }); 20 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const gulp = require('gulp'); 5 | const concat = require('gulp-concat'); 6 | const less = require('gulp-less'); 7 | const uglify = require('gulp-uglify'); 8 | const minifyCSS = require('gulp-clean-css'); 9 | const del = require('del'); 10 | const shell = require('gulp-shell'); 11 | 12 | /** 13 | * Production css file 14 | * @type {String} 15 | */ 16 | const CSS_DIST = 'main.min.css'; 17 | /** 18 | * Production js file 19 | * @type {String} 20 | */ 21 | const JS_DIST = 'main.min.js'; 22 | /** 23 | * Production folder 24 | * @type {String} 25 | */ 26 | const DIST_FOLDER = './dist/'; 27 | 28 | // Concat js files and uglify/minify them 29 | gulp.task('scripts', function() { 30 | gulp.src(['./js/**/*.js']) 31 | .pipe(concat(JS_DIST)) 32 | .pipe(uglify({mangle: false})) 33 | .pipe(gulp.dest(DIST_FOLDER)); 34 | }); 35 | 36 | // Remove all js files from the production folder 37 | gulp.task('clean-js', function() { 38 | del([`${DIST_FOLDER}*.js`, ]).then(paths => { 39 | paths.length && console.log('Removed:\n', paths.join('\n')); 40 | }); 41 | }); 42 | 43 | // Remove all css files from the production folder 44 | gulp.task('clean-css', function() { 45 | // Your code here 46 | }); 47 | 48 | 49 | gulp.task('build', ['clean-js', 'scripts']); 50 | 51 | gulp.task('deploy', ['build']); 52 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 |