title: Express won't return HTTP response from one controller, but does in others
body: <p>Thanks for looking into my question.</p>
  
  <p>I have a node/express server, configured with a server.js file, which calls urls.js which in turn calls controllers for handling http requests, and all of them are configured identically and all work fine, except for one.</p>
  
  <p>It's my OrderController.  The OrderController.js never gets called, and thus never returns any HTTP responses even though I'm as sure as I can be that it should be getting called.</p>
  
  <p>I've tried adding logging statements all over OrderController.js, but they never fire.  Nothing in my OrderController.js is running at all.</p>
  
  <p>I've inspected my urls.js file carefully but can find no clue why OrderController would fail to load, while my other 8 controllers all work fine.</p>
  
  <p>I've added logging statements to my server.js file to ensure that my server.js file is indeed handling all http requests and passing them correctly to my urls.js file.</p>
  
  <p>I've added logging statements to my urls.js file to confirm that it is being executed.</p>
  
  <p>I've logged the controllers, both require(OrderController.js) and my other controllers, and inspected the dumped json objects, but couldn't determine anything different or mistaken from the output I got.</p>
  
  <p>The repository is: <a href="https://github.com/allenchan3/foodproject/tree/40a43231ae49989a35fb0c004a897bbee69fe669" rel="nofollow noreferrer">https://github.com/allenchan3/foodproject/tree/40a43231ae49989a35fb0c004a897bbee69fe669</a></p>
  
  <p>In theory, the problem should be somewhere in <a href="https://github.com/allenchan3/foodproject/blob/40a43231ae49989a35fb0c004a897bbee69fe669/server/config/urls.js" rel="nofollow noreferrer">urls.js</a>:</p>
  
  <pre><code>const path = require("path");
  const staticFilesError = require("./errors").errorHTML;
  module.exports = function(app, staticDir) {
      const loginRegController = require(path.join("..","controllers","LoginRegController"));
      const controllers = {
          'categories': require(path.join("..","controllers","CategoryController")),
          'diningrooms':require(path.join("..","controllers","DiningRoomController")),
          'ingredients':require(path.join("..","controllers","IngredientController")),
          'items':      require(path.join("..","controllers","ItemController")),
          'options':    require(path.join("..","controllers","OptionController")),
          'orders':     require(path.join("..","controllers","OrderController")),
          'tables':     require(path.join("..","controllers","TableController")),
          'users':      require(path.join("..","controllers","UserController")),
      };
  
      for (key in controllers) {
          app.use("/api/"+key, controllers[key]);
      }
      app.use(loginRegController);
      app.get(/^\/api\//, (req, res) =&gt; res.status(404).json({"error":req.url+" not found"}));
      app.get("*", (_,res) =&gt; res.sendFile(staticDir+"/index.html"));
  }
  </code></pre>
  
  <p>I am just trying to make HTTP GET requests to <code>/api/orders/</code> and get something from the order controller (currently it should get a list of all orders from my database).  I also made a handler for <code>/hello</code> so <code>/api/orders/hello</code> should be at least returning something.  Whats actually happening is no http response ever comes, not even a 404, and I don't have any idea why.</p>