title: Alamofire http request to local webserver
body: <p>I'm developing an iPhone app and the plan is to send a JSON packet every so often from the app to a local webserver.  To do this, I had planned to use <a href="https://github.com/Alamofire/Alamofire" rel="noreferrer">Alamofire</a>. My POST method looks like this:</p>
  
  <pre><code>Alamofire.request(Alamofire.Method.POST, "http://XXX.XX.X.XX:3000/update", parameters: dictPoints, encoding: .JSON)
      .responseJSON {(request, response, JSON, error) in
      println(JSON)
  }
  </code></pre>
  
  <p>The IP address is marked out, but I've made sure that this corresponds to the IPv4 wireless address of my local server.  The server is set to listen to port 3000.  The server configuration looks like this:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var mongoose = require('mongoose');
  
  mongoose.connect('mongodb://localhost/test');
  
  var db = mongoose.connection;
  db.on('error', console.error.bind(console, 'connection error:'));
  db.once('open', function (callback) {
    console.log("MongoDB connection is open.");
  });
  
  // Mongoose Schema definition
  var Schema = mongoose.Schema;
  var LocationSchema = new Schema({
      //some schema here
  });
  
  // Mongoose Model definition
  var LocationsCollection = mongoose.model('locations', LocationSchema);
  
  // URL management
  app.get('/', function (req, res) {
      res.sendFile(__dirname + '/index.html');
  });
  
  app.get('/update', function (req, res) {
      console.log("Got something from the phone!");
  });
  
  // Start the server
  var server = app.listen(3000, function () {
    var host = server.address().address
    var port = server.address().port
    console.log('App listening at %s:%s',host, port)
  })
  </code></pre>
  
  <p>So, this server seems to work ok.  I can test it in my browser and type the URL: <a href="http://127.0.0.1:3000" rel="noreferrer">http://127.0.0.1:3000</a> and it will feed me the index.html file.  If I type in <a href="http://127.0.0.1:3000/update" rel="noreferrer">http://127.0.0.1:3000/update</a>... then I get the "Got something from the phone!" message.  However, when I run my app (making sure my phone is on the same wireless network as the server) and the Alamofire method gets called... the response I get is nil.  I also don't see the "Got something from the phone!" message.  Can anyone let me know why that would be happening... or better yet, how to fix it?</p>