gallery.accords-library.com/client/js/main.js

33 lines
1.0 KiB
JavaScript
Raw Normal View History

'use strict';
require('./util/polyfill.js');
2016-04-05 15:57:26 +00:00
require('./util/handlebars-helpers.js');
let controllers = [];
2016-04-07 17:03:49 +00:00
const authController = require('./controllers/auth_controller.js');
controllers.push(authController);
controllers.push(require('./controllers/posts_controller.js'));
controllers.push(require('./controllers/users_controller.js'));
controllers.push(require('./controllers/help_controller.js'));
controllers.push(require('./controllers/comments_controller.js'));
controllers.push(require('./controllers/history_controller.js'));
controllers.push(require('./controllers/tags_controller.js'));
controllers.push(require('./controllers/home_controller.js'));
2016-04-07 17:03:49 +00:00
const events = require('./events.js');
const page = require('page');
for (let controller of controllers) {
controller.registerRoutes();
}
2016-04-07 17:03:49 +00:00
authController.login().then(() => {
page();
}).catch(errorMessage => {
page();
page('/');
events.notify(
events.Error,
'An error happened while trying to log you in: ' + errorMessage);
});