title: My Node.js gets an Route.post() got a object Undefined error
body: <p>I did a simple modularization through Node.js.</p>
  
  <p>And I tried to do an api test through Postman, but my nodemon says that the following error occurred.</p>
  
  <p><strong>error</strong></p>
  
  <pre><code>Error: Route.post() requires a callback function but got a [object Undefined]
      at Route.
  </code></pre>
  
  <p><strong>routes/router.js</strong></p>
  
  <pre><code>const express = require('express');
  const route = express.Router();
  const user = require('../controller/user');
  
  route.route('/user')
      .post(user.createUser)
      .get(user.readUser)
      .put(user.updateUser)
      .delete(user.deleteUser)
  
  module.exports = route;
  </code></pre>
  
  <p><strong>controller/user.js</strong></p>
  
  <pre><code>exports.createUser = function (req, res) {
      res.send('user create.')
  }
  
  exports.readUser = function (req, res) {
      res.send('user read.')
  }
  
  exports.updateUser = function (req, res) {
      res.send('user update.')
  }
  
  exports.deleteUser = function (req, res) {
      res.send('user delete.')
  }
  </code></pre>
  
  <p><strong>server.js</strong></p>
  
  <pre><code>const express = require('express');
  const app = express();
  const port = process.env.PORT || 3000;
  const router = require('./routes/router');
  
  app.use(router);
  
  app.listen(port, err =&gt; {
      if(err) console.log(err)
      else console.log('server on');
  });
  </code></pre>
  
  <p>What's wrong with me?</p>