-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
140 additions
and
88 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
node_modules | ||
.app/ | ||
.DS_Store | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
pids | ||
logs | ||
results | ||
|
||
npm-debug.log | ||
node_modules |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> <html> <head> <title>post.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="posts.html"> posts.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="post.html"> post.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> post.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nv">mongoose = </span><span class="nx">require</span> <span class="s">'mongoose'</span> | ||
|
||
<span class="nv">Post = </span><span class="k">new</span> <span class="nx">mongoose</span><span class="p">.</span><span class="nx">Schema</span><span class="p">(</span> | ||
<span class="nv">title: </span><span class="nb">String</span> | ||
<span class="nv">body: </span><span class="nb">String</span> | ||
<span class="nv">url: </span><span class="nb">String</span> | ||
<span class="p">)</span> | ||
|
||
<span class="nv">module.exports = </span><span class="nx">mongoose</span><span class="p">.</span><span class="nx">model</span> <span class="s">'Post'</span><span class="p">,</span> <span class="nx">Post</span> | ||
|
||
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> <html> <head> <title>posts.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="posts.html"> posts.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="post.html"> post.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> posts.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nv">Post = </span><span class="nx">require</span> <span class="s">'../models/Post'</span> | ||
|
||
<span class="nv">module.exports = </span> | ||
<span class="nv">index: </span><span class="nf">(req, res) -></span> | ||
<span class="nx">Post</span><span class="p">.</span><span class="nx">find</span> <span class="p">{},</span> <span class="nf">(err, posts) -></span> | ||
<span class="nx">res</span><span class="p">.</span><span class="nx">render</span> <span class="s">"posts/index"</span><span class="p">,</span> | ||
<span class="nv">title: </span><span class="s">"home"</span> | ||
<span class="nv">posts: </span><span class="nx">posts</span> | ||
|
||
<span class="k">new</span><span class="o">:</span> <span class="nf">(req, res) -></span> | ||
<span class="nx">res</span><span class="p">.</span><span class="nx">render</span> <span class="s">'posts/new'</span><span class="p">,</span> <span class="nx">title</span><span class="o">:</span><span class="s">"Write New Post"</span> | ||
|
||
<span class="nv">create: </span><span class="nf">(req, res) -></span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span> <span class="nx">req</span><span class="p">.</span><span class="nx">body</span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span> <span class="s">'--------------------'</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>new Post(req.body.post).save -> | ||
res.redirect "/"</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">show: </span><span class="nf">(req, res) -></span> | ||
<span class="nx">Post</span><span class="p">.</span><span class="nx">findById</span> <span class="nx">req</span><span class="p">.</span><span class="nx">params</span><span class="p">.</span><span class="nx">id</span><span class="p">,</span> <span class="nf">(err, post) -></span> | ||
<span class="nx">res</span><span class="p">.</span><span class="nx">render</span> <span class="s">'post'</span><span class="p">,</span> <span class="nv">post: </span><span class="nx">post</span><span class="p">,</span> <span class="nv">title: </span><span class="nx">post</span><span class="p">.</span><span class="nx">title</span> | ||
|
||
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
require('./app'); | ||
require('./.app'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
extends layout | ||
block content | ||
.container | ||
.four.columns | ||
div. | ||
<a href="http://www.flickr.com/photos/astrapica/2560897976/" title="Uk express... by astrapi, on Flickr"><img src="http://farm4.staticflickr.com/3049/2560897976_48257593b7.jpg" width="100%" height="120px" alt="Uk express..."></a> | ||
a.button(href="https://github.com/twilson63/express-coffee/zipball/v1.3.0") Download | ||
| ||
a.button(href="https://github.com/twilson63/express-coffee") Source | ||
:markdown | ||
### About | ||
|
||
This template was built to make it very easy to get up and going on small little prototypes and weekend projects. | ||
|
||
### Contact Us | ||
|
||
Have questions, or would like to contribute? | ||
|
||
* [Post an Issue](https://github.com/twilson63/express-coffee/issues) | ||
* [Submit a pull request](https://github.com/twilson63/express-coffee) | ||
* Follow Us on twitter! [@jackhq](http://twitter.com/jackhq) | ||
.right.ten.columns.offset-by-two | ||
:markdown | ||
The express-coffee template is now upgraded to use node version 0.6.17+ and refined to utilized a few new features to get up and running. | ||
|
||
# Features | ||
|
||
### Automated Compile Step | ||
|
||
express-coffee template is made to quickly start putting together an application/prototype. | ||
|
||
Now you can run cake dev and when every coffee file is changed it will rebuild the app. | ||
|
||
Also, it includes supervisor, which will restart you application everytime you change your views or js files. | ||
|
||
cake dev | ||
|
||
|
||
### Rails-like Asset Pipeline | ||
|
||
express-coffee template comes ready to go with connect-assets a rails like asset pipeline. You can add your css and js to the assets folder. Then in jade you can reference your assets using a couple of helper methods. | ||
|
||
!= css('mycss') | ||
#= Pull from /assets/css/mycss.styl | ||
!= js('app') | ||
#= Pull from /assets/js/app.coffee or app.js | ||
|
||
See [connect-assets](http://github.com/TrevorBurnham/connect-assets) for more information | ||
|
||
### Jade as the default template language | ||
|
||
express-coffee template as switched to jade as the default template language. It seems to be the clear winner and the most mature at this point. The rich featureset of integrating markdown and coffeescript and other helpers is big plus for getting things up fast. | ||
|
||
extends layout | ||
block content | ||
.container | ||
.four.columns | ||
:markdown | ||
# Hello World | ||
|
||
### Skeleton CSS as the default responsive grid | ||
|
||
skeleton is clean and basic and can easily be adjusted. | ||
|
||
### Mocha and Request for testing | ||
|
||
mocha is an extremely powerful and easy to use testing framework | ||
|
||
see [http://visionmedia.github.com/mocha/](http://visionmedia.github.com/mocha/) | ||
|
||
describe 'Sample test', -> | ||
it 'should be true', -> | ||
true.should.equal true | ||
|
||
to run mocha | ||
|
||
cake test | ||
|
||
### Setup to deploy to heroku | ||
|
||
rm -rf .git | ||
git init | ||
echo 'node_modules' >> '.gitignore' | ||
git add . | ||
git commit -am "first commit" | ||
heroku create | ||
git push heroku master | ||
heroku open |