Skip to content

Commit 31d57a6

Browse files
committed
minor
1 parent 785c4e7 commit 31d57a6

10 files changed

Lines changed: 18 additions & 275 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ download/
2626
# database dump for tutorial export
2727
dump/
2828

29+
# extra handlers are not in the repo
30+
extra/
31+
2932
# NPM packages folder.
3033
node_modules/
3134

extra/.gitkeep

Whitespace-only changes.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const runSequence = require('run-sequence');
1111
const linkModules = require('./modules/linkModules');
1212

1313
linkModules({
14-
src: ['client', 'styles', 'modules/*', 'handlers/*']
14+
src: ['client', 'styles', 'modules/*', 'handlers/*', 'extra/*']
1515
});
1616

1717
const config = require('config');

handlers/tutorial/controller/bookify.js

Lines changed: 0 additions & 141 deletions
This file was deleted.

handlers/tutorial/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ function addNodeIgnores(app) {
2020

2121

2222
exports.Article = require('./models/article');
23+
exports.ArticleRenderer = require('./renderer/articleRenderer');
2324
exports.Reference = require('./models/reference');
2425
exports.Task = require('./models/task');
26+
exports.TaskRenderer = require('./renderer/taskRenderer');

handlers/tutorial/router.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var Router = require('koa-router');
22

33
var task = require('./controller/task');
44
var article = require('./controller/article');
5-
var bookify = require('./controller/bookify');
65
var frontpage = require('./controller/frontpage');
76
var node = require('./controller/node');
87
var zipview = require('./controller/zipview');
@@ -18,9 +17,3 @@ router.get('/tutorial/map', map.get);
1817
router.get('/tutorial/zipview/:name', zipview.get);
1918
router.get('/tutorial', frontpage.get);
2019
router.get('/:slug', article.get);
21-
22-
if (process.env.NODE_ENV == 'ebook') {
23-
router.get('/pdf/:slug', bookify.get);
24-
router.get('/epub/:slug', bookify.get);
25-
}
26-

handlers/tutorial/templates/bookify.jade

Lines changed: 0 additions & 117 deletions
This file was deleted.

modules/app.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ app.requireHandler('paymentsMethods');
9999

100100
// ======== Endpoint services that actually generate something ==========
101101

102-
var endpoints = ['frontpage'];
102+
var endpoints = [];
103103

104104
if (process.env.NODE_ENV == 'development') {
105105
endpoints.push('markup', 'dev');
106106
}
107107

108108
endpoints.push(
109-
'users', 'auth', 'ebook', 'cache', 'search', 'profile', 'jb', 'play', 'nodejsScreencast',
109+
'users', 'auth', 'frontpage', 'ebook', 'cache', 'search', 'profile', 'jb', 'play', 'nodejsScreencast',
110110
'profileGuest', 'quiz', 'currencyRate', 'payments', 'download', 'staticPage', 'newsletter', 'mailer'
111111
);
112112

@@ -119,6 +119,11 @@ endpoints.forEach(function(name) {
119119
app.requireHandler(name);
120120
});
121121

122+
require('fs').readdirSync(config.extraHandlersRoot).forEach(function(extraHandler) {
123+
if (extraHandler[0] == '.') return;
124+
app.requireHandler(extraHandler);
125+
});
126+
122127

123128
// uncomment for time-require to work
124129
//process.emit('exit');

modules/config/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ module.exports = {
106106
// private files, for expiring links, not directly accessible
107107
downloadRoot: path.join(process.cwd(), 'download'),
108108
tmpRoot: path.join(process.cwd(), 'tmp'),
109+
// extra handlers from outside of the main repo
110+
extraHandlersRoot: path.join(process.cwd(), 'extra'),
109111
// js/css build versions
110112
manifestRoot: path.join(process.cwd(), 'manifest')
111113
};

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
"nodemailer": "*",
8787
"nodemailer-ses-transport": "*",
8888
"nodemon": "*",
89-
"passport": "*",
9089
"passport-facebook": "*",
9190
"passport-github": "*",
9291
"passport-google-oauth": "git://github.com/iliakan/passport-google-oauth",
@@ -169,17 +168,14 @@
169168
"supertest": "*",
170169
"time-require": "*"
171170
},
172-
"engines": {
173-
"node": ">=0.12"
174-
},
175171
"engineStrict": true,
176172
"repository": {
177173
"type": "git",
178-
"url": "https://github.com/iliakan/javascript-nodejs.git"
174+
"url": "https://github.com/iliakan/javascript.git"
179175
},
180-
"author": "Ilya Kantor and other contributors in git repo",
176+
"author": "Ilya Kantor",
181177
"license": "CC BY-NC-SA 3.0",
182178
"bugs": {
183-
"url": "https://github.com/iliakan/javascript-nodejs/issues"
179+
"url": "https://github.com/iliakan/javascript/issues"
184180
}
185181
}

0 commit comments

Comments
 (0)