code: function(options, callback) {
  
       //Validate port
       if(options.port == 80){
         throw "Invalid server port specified. Port 80 is reserved.";
       }
  
       // fire up the server
       RNHS.init(options, function() {
  
         // listen for new requests and retrieve appropriate response
         DeviceEventEmitter.addListener('reactNativeHttpServerResponse', function(request) {
  
           var success = true;
  
           var promise = new Promise(function(resolve, reject){
             callback(request, resolve);
           })
           .then(function(response){
  
             //Validate status code
             if(validStatusCodes.indexOf(response.status) === 0){
               success = false;
               throw "Invalid response status code specified in RNHttpServer options.";
             }
  
             //Set default MIME_TYPE
             if(response.type === null){
               response.type = "text/plain";
             }
  
             //Set default data field to zero length string
             if(response.data === null){
               response.data = "";
             }
  
             if(response.headers === null){
               response.headers = {};
             }
  
             if(success){
               RNHS.setResponse(request.url, response);
             }
  
           });
  
         });
  
       }, function(e){
         throw "Could not initialise server: " + e;
       });
  
     }
docs: create the server and listen/respond to requests