Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit a8d71aa

Browse files
committed
Moved files to first_iteration and started a basic react project. Waiting on a spec.
1 parent 276f9ca commit a8d71aa

File tree

10 files changed

+54
-0
lines changed

10 files changed

+54
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.DS_Store
2+
node_modules
File renamed without changes.
File renamed without changes.

Diff for: index.html renamed to first_iteration/index.html

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: index.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var Hapi = require('hapi');
2+
var Path = require('path');
3+
4+
var server = new Hapi.Server({
5+
connections: {
6+
routes: {
7+
files: {
8+
relativeTo: Path.join(__dirname, 'public')
9+
}
10+
}
11+
}
12+
});
13+
server.connection({ port: 3000 });
14+
15+
server.route({
16+
method: 'GET',
17+
path: '/',
18+
handler: function(request, reply) {
19+
reply.file('templates/index.html');
20+
}
21+
});
22+
23+
server.route({
24+
method: 'GET',
25+
path: '/js/components/{filename}',
26+
handler: function(request, reply) {
27+
reply.file('js/components/'+request.params.filename);
28+
}
29+
});
30+
31+
32+
33+
server.start(function () {
34+
console.log('Server running at:', server.info.uri);
35+
});

Diff for: public/js/components/hello.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var Hello = React.createClass({
2+
render: function() {
3+
return <div>Hello {this.props.name}</div>;
4+
}
5+
});
6+
7+
React.render(<Hello name="World" />, document.getElementById('container'));

Diff for: public/templates/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<html>
2+
<head>
3+
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js"></script>
4+
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons.js"></script>
5+
</head>
6+
<body>
7+
<div id="container">
8+
<!-- This element's contents will be replaced with your component. -->
9+
</div>
10+
<script type="text/jsx" src="js/components/hello.js"></script>
11+
</body>

0 commit comments

Comments
 (0)