├── server.js ├── views ├── index.jade └── layout.jade ├── public └── css │ └── style.css ├── routes └── index.js ├── models └── posts.json ├── app.js ├── package.json └── npm-debug.log /server.js: -------------------------------------------------------------------------------- 1 | var app = require('./app'); 2 | 3 | app.listen(process.env.PORT || 3000); 4 | -------------------------------------------------------------------------------- /views/index.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1 Inky 5 | 6 | each post in posts 7 | h2= post.title 8 | p= post.content 9 | -------------------------------------------------------------------------------- /public/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /views/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/css/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /routes/index.js: -------------------------------------------------------------------------------- 1 | var posts = require('./../models/posts'); 2 | 3 | module.exports.index = function(req, res) { 4 | res.render('index', { posts: posts }); 5 | }; 6 | -------------------------------------------------------------------------------- /models/posts.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "title": "Node in Practice", "content": "You too can become a Node professional!" }, 3 | { "title": "Welcome to my blog", "content": "This is my first post" } 4 | ] 5 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | var routes = require('./routes'); 4 | 5 | app.use(express.logger()); 6 | app.set('env', process.env.NODE_ENV || 'development'); 7 | app.set('port', process.env.PORT || 3000); 8 | app.set('views', './views'); 9 | app.set('view engine', 'jade'); 10 | 11 | app.use(app.router); 12 | app.use(express.static('./public')); 13 | 14 | app.get('/', routes.index); 15 | 16 | module.exports = app; 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inky", 3 | "version": "0.0.0-1", 4 | "description": "A little blog example", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "author": "Alex R. Young", 11 | "license": "MIT", 12 | "dependencies": { 13 | "express": "^3.4.8", 14 | "jade": "^1.3.0" 15 | }, 16 | "subdomain": "alexyoung-inky", 17 | "engines": { 18 | "node": "0.10.x" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /npm-debug.log: -------------------------------------------------------------------------------- 1 | 0 info it worked if it ends with ok 2 | 1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ] 3 | 2 info using npm@1.4.3 4 | 3 info using node@v0.10.26 5 | 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 6 | 5 info prestart inky@0.0.0-1 7 | 6 info start inky@0.0.0-1 8 | 7 verbose unsafe-perm in lifecycle true 9 | 8 info inky@0.0.0-1 Failed to exec start script 10 | 9 error inky@0.0.0-1 start: `node server.js` 11 | 9 error Exit status 8 12 | 10 error Failed at the inky@0.0.0-1 start script. 13 | 10 error This is most likely a problem with the inky package, 14 | 10 error not with npm itself. 15 | 10 error Tell the author that this fails on your system: 16 | 10 error node server.js 17 | 10 error You can get their info via: 18 | 10 error npm owner ls inky 19 | 10 error There is likely additional logging output above. 20 | 11 error System Darwin 13.1.0 21 | 12 error command "node" "/usr/local/bin/npm" "start" 22 | 13 error cwd /private/tmp/inky-heroku 23 | 14 error node -v v0.10.26 24 | 15 error npm -v 1.4.3 25 | 16 error code ELIFECYCLE 26 | 17 verbose exit [ 1, true ] 27 | --------------------------------------------------------------------------------