This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
// make express look in the public directory for assets (css/js/img) | |
app.use(express.static(path.join(__dirname))); | |
app.use("/styles", express.static(__dirname + '/css')); | |
app.use("/scripts", express.static(__dirname + '/scripts')); | |
app.use("/images", express.static(__dirname + '/img')); | |
app.use("/components", express.static(__dirname + '/bower_components')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
app.use(express.static(path.join(__dirname))); | |
app.use("/styles", express.static(__dirname)); | |
app.use("/images", express.static(__dirname + '/images')); | |
app.use("/scripts", express.static(__dirname + '/scripts')); | |
// viewed at based directory http://localhost:8080/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hasLegsMaker = num => ({ legs: num }); | |
const noiseMaker = noise => { | |
return { makeNoise: () => { console.log(`All day I just ${noise}`) } }; | |
}; | |
var fido = Object.assign({}, hasLegsMaker(4), noiseMaker('woof!')); | |
fido.makeNoise(); //All day I just woof! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal { | |
constructor(name, legs) { | |
this.name = name; | |
this.legs = legs; | |
} | |
} | |
class Dog extends Animal { | |
constructor(name) { | |
super(name, 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal { | |
constructor(name, legs) { | |
this.name = name; | |
this.legs = legs; | |
} | |
} | |
class Dog extends Animal { | |
constructor(name) { | |
super(name, 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
devtool: 'source-map', | |
entry: [ | |
'./app/index.js' | |
], | |
output: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
devtool: 'source-map', | |
entry: [ | |
'./app/index.js' | |
], | |
output: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var webpack = require('webpack'); | |
module.exports = { | |
entry: './app/index.js', | |
output: { | |
path: __dirname, | |
filename: 'bundle.js', | |
publicPath: '/app/assets/' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"parserOptions": { |