var express = require('express'),
    pkg     = require('./package.json'),
    mkdirp  = require('mkdirp'),
    uuid    = require('node-uuid'),
    auth    = require('./middlewares/auth'),
    config  = require('./config/'),
    routes  = require('./routes/');

/*
 * Setup the path to save files to  
 */

mkdirp(config.diskPath);

/*
 * Setup express app
 */

var server = express();

server.use(express.urlencoded());
server.use(express.json());
server.use(express.cookieParser());
server.use(express.session({ secret: uuid.v4() }));
server.use(auth);

server.use(function(req, res, next) {
  res.header('X-Docker-Registry-Version', pkg.version);
  res.header('X-Docker-Registry-Config', config.env);
  next();
});

/*
 * Setup routes
 */

routes.hookRoutes(server);

/*
 * Setup webserver
 */

server.listen(config.port);

@@ -251,29 +251,27 @@
 routes/');%0A%0A
-/*%0A *
+%0A//
  Setup the p
@@ -294,15 +294,8 @@
 s to
-  %0A */%0A
 %0Amkd
@@ -314,28 +314,25 @@
 iskPath);%0A%0A/
-*%0A *
+/
  Setup expre
@@ -338,21 +338,16 @@
 ess app%0A
- */%0A%0A
 var serv
@@ -572,31 +572,67 @@
 xt) %7B%0A  res.
-header(
+set(%7B%0A    'X-Powered-By': 'SpaceDock',%0A    
 'X-Docker-Re
@@ -646,17 +646,17 @@
 Version'
-,
+:
  pkg.ver
@@ -663,24 +663,14 @@
 sion
-);%0A  res.header(
+,%0A    
 'X-D
@@ -691,17 +691,17 @@
 -Config'
-,
+:
  config.
@@ -703,16 +703,20 @@
 nfig.env
+%0A  %7D
 );%0A  nex
@@ -730,20 +730,17 @@
 ;%0A%0A/
-*%0A *
+/
  Setup r
 oute
@@ -739,18 +739,22 @@
 up r
+egistry r
 outes
-%0A */%0A
 %0Arou
@@ -783,12 +783,9 @@
 ;%0A%0A/
-*%0A *
+/
  Set
@@ -801,13 +801,8 @@
 ver%0A
- */%0A%0A
 serv

Add X-Powered-By header