var express = require('express')
  , app = express()
  , server = require('http').createServer(app)
  , controllers = require('./controllers');

var mongoose = require('mongoose');

//console.log('connecting to MongoDB: ' + process.env.MONGODB_CONNECTION_STRING);
//mongoose.connect(process.env.MONGODB_CONNECTION_STRING);

app.use(express.logger());
app.use(express.bodyParser());

app.get('/location',  controllers.locations.index);
app.post('/location',  controllers.locations.create);

app.get('/tiles/:id',  controllers.tiles.show);
app.get('/tiles',  controllers.tiles.index);
app.post('/tiles', controllers.tiles.create);

server.listen(process.env.PORT);

console.log('tile server listening on port: ' + process.env.PORT);

@@ -313,24 +313,457 @@
 N_STRING);%0A%0A
+app.use(function(req, res, next) %7B%0A    res.header('Access-Control-Allow-Origin', %22*%22);%0A    res.header('Access-Control-Allow-Credentials', true);%0A    res.header('Access-Control-Allow-Methods', 'OPTIONS,GET,POST,PUT,DELETE');%0A    res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');%0A%0A    // intercept OPTIONS method%0A    if ('OPTIONS' == req.method) %7B%0A        res.send(200);%0A    %7D else %7B%0A        next();%0A    %7D%0A%7D);%0A
 app.use(expr

add cross origin