i have created user model, register and login routes with authentification. Atlas Mongodb created new collection. I can post register to db and login, so it works fine.

Later i added rope model and crud routes, i can access get route but when i try to post new rope to db, error is triggered and new collection is not added to atlas MongoDb. i cannot figure why.

rope model Rope.js:

```
const mongoose = require('mongoose')

const ropeSchema = new mongoose.Schema({
    name:{
        type: String,
        required: true,

    },

    description:{
        type: String,
        required: true,

    }

})

module.exports = mongoose.model('Rope', ropeSchema)

```

routes file ropes.js:

```
const router = require('express').Router();
const Rope = require('../model/Rope')

router.post('/', async (req, res) => {

    //create a new user
    const rope = new Rope({
        name: req.body.name,
        description: req.body.description
    });
    try {
        await rope.save();
        res.json(rope);
    } catch (err) {
        res.status(500 ).send(err);
    }
});

module.exports = router;

```

index.js file:

```
const mongoose = require('mongoose')
const authRoute = require('./routes/auth');
const ropesRoute = require('./routes/ropes')
const bodyparser = require('body-parser')

app.use(bodyparser.json());

dotenv.config()

mongoose.connect(process.env.DB_CONNECT, {
    useNewUrlParser: true,
    useUnifiedTopology: true
}, () => console.log('connected to db'))

app.use(express.json())

app.use('/api/user', authRoute);
app.use('/api/ropes', ropesRoute)

app.listen(3000, () => console.log('up and running'))

```