var errors = require('../lib/errors');

module.exports = function (app) {
	require('./users')(app);
	require('./followship')(app);
	require('./admin')(app);
	require('./admin/')(app);
	require('./groups')(app);
	require('./activities')(app);
	require('./issues')(app);
	require('./photos')(app);
	require('./cooperations')(app);
	require('./starship')(app);
	require('./events')(app);

	app.use('/api', function (data, req, res, next) {
		if (data instanceof Error) return next(data);
		res.send(data);
	});
	app.use('/api', function (err, req, res, next) {
		if (!err['code']) {
			console.error(err.stack ? err.stack : err);
			err = errors[10001];
		}
		res.sendErr(err);
	});
	app.use('/api', function (req, res) {
		res.sendErr(errors[10020]);
	});
};

@@ -154,35 +154,8 @@
 p);%0A
-%09require('./admin/')(app);%0A
 %09req
@@ -720,11 +720,129 @@
 );%0A%09%7D);%0A
+%09app.use('/admin', function (req, res, next)%7B%0A%09%09if(!req.admin)%7B%0A%09%09%09res.end('please login first!');%0A%09%09%7D%0A%09%09next();%0A%09%7D);%0A
 %7D;%0A

use admin