# Postman Internal Server Error

**URL:** <https://forum.codewithmosh.com/t/postman-internal-server-error/2532>\
**Category:** Node\
**Created:** [February 8, 2021, 1:44pm UTC](https://forum.codewithmosh.com/t/postman-internal-server-error/2532 "2021-02-08T13:44:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinstargie](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@shinstargie](https://forum.codewithmosh.com/u/shinstargie)\
**Post date:** [February 8, 2021, 1:44pm UTC](https://forum.codewithmosh.com/t/postman-internal-server-error/2532/1 "2021-02-08T13:44:48Z")

</div>

Hi there!

I’m following the **Calling endpoints using Postman** in the Node course and I’m receiving an internal server 500 error in Postman. The error I receive in the cmd prompt is **TypeError: Cannot read property ‘name’ of undefined**.

The code I’m running is identical to the one shared in the lesson. See the screen recording below. I’ve included the code I’m running as well.

Screen recording: [Loom | Free Screen & Video Recording Software](https://www.loom.com/share/38674ad935344c0399ffac7a17567cd0)

Code:

```
const express = require('express');

const app = express();

const courses = [

  { id: 1, name: 'course1' },

  { id: 2, name: 'course2' },

  { id: 3, name: 'course3' }

];

app.get('/api/courses', (req, res) => {

  res.send(courses);

});

app.post('/api/courses', (req, res) => {

  const course = {

    id: courses.length + 1,

    name: req.body.name

  }

  courses.push(course);

  res.send(course);

});

app.get('/api/courses/:id', (req, res) => {

  const course = courses.find(c => c.id === parseInt(req.params.id));

  if(!course) res.status(404).send('The course with the given ID was not found');

  res.send(course);

});

const port = process.env.PORT || 3000;

app.listen(port, () => { console.log(`listening on port ${port}...`) });
```

---

<div class="post-metadata">

**Author:** ![shinstargie](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@shinstargie](https://forum.codewithmosh.com/u/shinstargie)\
**Post date:** [February 11, 2021, 1:39am UTC](https://forum.codewithmosh.com/t/postman-internal-server-error/2532/2 "2021-02-11T01:39:25Z")

</div>

Issue resolved. I was missing the middleware piece of code **app.use(express.json());**
