This file contains hidden or 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 router = require('page'), | |
| qs = require('qs'), | |
| react = require('react'), | |
| routes = require('./routes') | |
| router(function(req, next) { | |
| req.query = qs.parse(req.querystring) | |
| next() | |
| }) |
This file contains hidden or 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'), | |
| serverMiddleware = require('./lib/server-middleware'), | |
| browserify = require('browserify-middleware'), | |
| routes = require('./routes') | |
| browserify.settings({ | |
| transform: ['reactify'], | |
| extensions: ['.js', '.jsx'], | |
| grep: /\.jsx?$/ | |
| }) |
This file contains hidden or 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'), | |
| reactTools = require('react-tools'), | |
| react = reactTools.React, | |
| readFile = require('fs').readFileSync, | |
| utils = require('./utils') | |
| require.extensions['.jsx'] = function(module, filename) { | |
| var source = readFile(filename, {encoding: 'utf8'}) | |
| try { |
This file contains hidden or 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 emitter = require('./emitter') | |
| var router = module.exports = emitter('unique') | |
| var $window = $(window), | |
| $document = $(document), | |
| $body = $(document.body) | |
| var leadingSlashPattern = /^\// |
This file contains hidden or 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'), | |
| reactTools = require('react-tools'), | |
| react = reactTools.React, | |
| readFile = require('fs').readFileSync, | |
| utils = require('./utils') | |
| require.extensions['.jsx'] = function(module, filename) { | |
| var source = readFile(filename, {encoding: 'utf8'}) | |
| try { |
This file contains hidden or 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
| /** @jsx React.DOM */ | |
| var ReactAsync = require('react-async'), | |
| superagent = require('superagent') | |
| module.exports = ReactAsync.createClass({ | |
| getInitialStateAsync: function(callback) { | |
| superagent | |
| .get('http://localhost:3000/api/users/' + this.props.username) | |
| .end(function(err, res) { |
This file contains hidden or 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 middleware = function(options) { | |
| options = options || {} | |
| var app = express() | |
| app.get('/foo') | |
| app.use('/bar' function(req, res) { | |
| res.send('Hello bar!') | |
| }) |
This file contains hidden or 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
| /** @jsx React.DOM */ | |
| 'use strict'; | |
| var React = require('react'), | |
| Router = require('./Router') | |
| module.exports = React.createClass({ | |
| displayName: 'Application', |
This file contains hidden or 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
| /** @jsx React.DOM */ | |
| 'use strict'; | |
| var React = require('react') | |
| module.exports = React.createClass({ | |
| displayName: 'Head', | |
| componentWillReceiveProps: function(nextProps) { |
This file contains hidden or 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
| // "Routes" | |
| function Home() { | |
| console.log('Home') | |
| } | |
| function Products(params) { | |
| console.log(params.category, 'products') | |
| } | |
| function ProductDetails(params) { |
OlderNewer