Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

move ready event up

  • Loading branch information...
commit 6117b98fd63bc39c8465328cf3e2d23e6b4df6b1 1 parent 8c62dec
@fjakobs fjakobs authored
Showing with 24 additions and 24 deletions.
  1. +24 −24 plugins-server/cloud9.core/ide-plugin.js
View
48 plugins-server/cloud9.core/ide-plugin.js
@@ -68,6 +68,30 @@ module.exports = function setup(options, imports, register) {
packedName: options.packedName
});
+ hub.on("ready", function() {
+ ide.init(serverPlugins);
+
+ connect.useAuth(baseUrl, function(req, res, next) {
+ if (!(req.session.uid || req.session.anonid))
+ return next(new error.Unauthorized());
+ // NOTE: This gets called multiple times!
+
+ var pause = utils.pause(req);
+
+ initUserAndProceed(req.session.uid || req.session.anonid, ide.options.workspaceId, function(err) {
+ if (err) {
+ next(err);
+ pause.resume();
+ return;
+ }
+ ide.handle(req, res, next);
+ pause.resume();
+ });
+ });
+
+ log.info("IDE server initialized. Listening on " + connect.getHost() + ":" + connect.getPort());
+ });
+
register(null, {
ide: {
register: function(name, plugin, callback) {
@@ -91,28 +115,4 @@ module.exports = function setup(options, imports, register) {
}
});
}
-
- hub.on("ready", function() {
- ide.init(serverPlugins);
-
- connect.useAuth(baseUrl, function(req, res, next) {
- if (!(req.session.uid || req.session.anonid))
- return next(new error.Unauthorized());
- // NOTE: This gets called multiple times!
-
- var pause = utils.pause(req);
-
- initUserAndProceed(req.session.uid || req.session.anonid, ide.options.workspaceId, function(err) {
- if (err) {
- next(err);
- pause.resume();
- return;
- }
- ide.handle(req, res, next);
- pause.resume();
- });
- });
-
- log.info("IDE server initialized. Listening on " + connect.getHost() + ":" + connect.getPort());
- });
};
Please sign in to comment.
Something went wrong with that request. Please try again.