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
case AppConstants.GET_RANDOM_RESPONSE: | |
// Construct the new todo string | |
var newTodo = 'Call ' | |
+ action.response.results[0].user.name.first | |
+ ' about real estate in ' | |
+ action.response.results[0].user.location.city; | |
// Add the new todo to the list | |
_store.list.push(newTodo); |
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
// Todo store | |
// | |
// Requiring the Dispatcher, Constants, and | |
// event emitter dependencies | |
var AppDispatcher = require('../dispatcher/AppDispatcher'); | |
var AppConstants = require('../constants/TodoConstants'); | |
var ObjectAssign = require('object-assign'); | |
var EventEmitter = require('events').EventEmitter; | |
var CHANGE_EVENT = 'change'; |
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
// React components | |
var React = require('react'); | |
var TodoStore = require('../stores/TodoStore.js'); | |
var TodoActions = require('../actions/TodoActions.js'); | |
var TodoItem = React.createClass({ | |
render: function() { | |
return( |
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
// Create a basic Hapi.js server | |
require('babel-register')({ | |
presets: ['es2015', 'react'], | |
}); | |
var Hapi = require('hapi'); | |
var dateFormat = require('dateformat'); | |
var format = "dd mmm HH:MM:ss"; | |
// Basic Hapi.js connection stuff | |
var server = new Hapi.Server(); |
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
// Default layout template | |
var React = require('react'); | |
var Default = React.createClass({ | |
render: function() { | |
return( | |
<html> | |
<head> |
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
// Webpack config file | |
module.exports = { | |
entry: './assets/js/components/Index.jsx', | |
output: { | |
path: __dirname + '/assets/js', | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ |
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
{ | |
"restartable": "rs", | |
"ignore": [ | |
".git", | |
"node_modules/**/node_modules", | |
"assets/*" | |
], | |
"ext": "js json jsx" | |
} |
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
FROM node:0.12 | |
MAINTAINER tribou | |
# Prepare app directory | |
RUN mkdir -p /usr/src/app | |
ADD . /usr/src/app | |
# Install dependencies | |
WORKDIR /usr/src/app | |
RUN npm install |
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
web: | |
build: . | |
links: | |
- db | |
environment: | |
- DB_HOST=db | |
ports: | |
- '8000:8000' | |
command: npm start | |
db: |
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
.git | |
.gitignore | |
.editorconfig | |
node_modules | |
*.log | |
*.md |