mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-11 15:10:45 +01:00
interim commit
This commit is contained in:
44
src/routes/install.js
Normal file
44
src/routes/install.js
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
var RDB = require('../redis.js');
|
||||
|
||||
(function(Install) {
|
||||
Install.create_routes = function(app) {
|
||||
|
||||
(function() {
|
||||
var routes = ['basic'];
|
||||
|
||||
for (var i=0, ii=routes.length; i<ii; i++) {
|
||||
(function(route) {
|
||||
app.get('/install/' + route, function(req, res) {
|
||||
res.send(templates['install/header'] + app.create_route('install/' + route) + templates['install/footer']);
|
||||
});
|
||||
}(routes[i]));
|
||||
}
|
||||
}());
|
||||
|
||||
//todo consolidate.
|
||||
app.get('/install', function(req, res) {
|
||||
res.send(templates['install/header'] + app.create_route('install/basic') + templates['install/footer']);
|
||||
});
|
||||
app.get('/install/index', function(req, res) {
|
||||
res.send(templates['install/header'] + app.create_route('install/index') + templates['install/footer']);
|
||||
});
|
||||
|
||||
|
||||
function api_method(req, res) {
|
||||
switch(req.params.method) {
|
||||
case 'basic' :
|
||||
res.send('{}');
|
||||
break;
|
||||
|
||||
default :
|
||||
res.send('{}');
|
||||
}
|
||||
}
|
||||
|
||||
app.get('/api/install/:method/:tab?*', api_method);
|
||||
app.get('/api/install/:method*', api_method);
|
||||
};
|
||||
|
||||
|
||||
}(exports));
|
||||
@@ -17,6 +17,7 @@ var express = require('express'),
|
||||
notifications = require('./notifications.js'),
|
||||
admin = require('./routes/admin.js'),
|
||||
userRoute = require('./routes/user.js'),
|
||||
installRoute = require('./routes/install.js'),
|
||||
auth = require('./routes/authentication.js');
|
||||
|
||||
(function(app) {
|
||||
@@ -62,6 +63,7 @@ var express = require('express'),
|
||||
auth.create_routes(app);
|
||||
admin.create_routes(app);
|
||||
userRoute.create_routes(app);
|
||||
installRoute.create_routes(app);
|
||||
|
||||
|
||||
app.create_route = function(url, tpl) { // to remove
|
||||
|
||||
Reference in New Issue
Block a user