BatmanSysy/FSA-Assignments — pull request #1 by BatmanSysy (2014-11-05 23:32:35+00:00)
Title: Feature/assignments/1 4

### FSA Assignments (1 - 4 )

- [x] Git / Github
- Add .gitignore file.
- Create branch '__feature/assignments/1-4__' for assignments.

-

- [x] Hapi
- Create simple route for index page.
```javascript
server = new Hapi.Server('localhost', 8000);
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply.view('index');
}
});
```

-

- [x] jQuery
- Use jQuery.ajax to fetch data from Hapi server and manipulate DOM

```javascript
$(function() {
var portfolioAPI = "http://localhost:8000/portfolio";
$.getJSON(portfolioAPI, {
format: "json"
})
.done(function( data ) {

$.each( data, function( i, item ) {

var div = $( "

", { "class": "col-sm-4 portfolio-item" });

var a = $( "", {
"href": item.href,
"class": "portfolio-link",
"data-toggle": "modal",
"html": "

"
});

var img = $( "", { "src": item.src, "class": "img-responsive" });

$(img).appendTo(a);
$(a).appendTo(div);
$(div).appendTo( "#portfolio-list" );

});
});
});
```

-

- [x] Bootstrap
- use `` for button
- use `

` for menu bar

-

#### screenshot :

![assignments1-4](https://cloud.githubusercontent.com/assets/9525174/4928352/7a0261fc-6543-11e4-804f-a13153baaec4.gif)