title: Node.js/Postgres - Server not accepting JSON
body: <p>I'm learning how to use the PERN stack and I am currently setting up my backend CRUD routes. I have initiated a Node.js server and Postgres database, but for some reason, my server won't write the JSON that I pass it to the database.</p>
  <p>My Node.js code looks like this:</p>
  <pre><code>app.post(&quot;/todos&quot;, async (req, res) =&gt; {
    try {
      const { description } = req.body;
      const newTodo = await pool.query(&quot;INSERT INTO todo (description) VALUES($1) RETURNING *&quot;, [description]);
  
      res.json(newTodo.rows[0]);
    } catch (err) {
      console.error(err.message);
    }
  });
  </code></pre>
  <p>I pass the following JSON to the server via Insomnia:</p>
  <pre><code>{
  &quot;description&quot;:&quot;Some new task&quot;
  }
  </code></pre>
  <p>Insomnia then gives me the following JSON back:</p>
  <pre><code>{
    &quot;todo_id&quot;: 14,
    &quot;description&quot;: null
  }
  </code></pre>
  <p>Upon further inspection, Insomnia gives me back the following details:</p>
  <pre><code>* Preparing request to http://localhost:5000/todos/
  * Using libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.40.0
  * Current time is 2020-08-12T02:32:19.473Z
  * Disable timeout
  * Enable automatic URL encoding
  * Enable SSL validation
  * Enable cookie sending with jar of 6 cookies
  * Connection 20 seems to be dead!
  * Closing connection 20
  *   Trying ::1:5000...
  * Connected to localhost (::1) port 5000 (#21)
  
  &gt; POST /todos/ HTTP/1.1
  &gt; Host: localhost:5000
  &gt; User-Agent: insomnia/2020.2.1
  &gt; Accept: */*
  &gt; Content-Length: 45
  
  | {
  |   &quot;description&quot;: &quot;I need to clean my room&quot;
  | }
  
  * upload completely sent off: 45 out of 45 bytes
  * Mark bundle as not supporting multiuse
  
  &lt; HTTP/1.1 200 OK
  &lt; X-Powered-By: Express
  &lt; Access-Control-Allow-Origin: *
  &lt; Content-Type: application/json; charset=utf-8
  &lt; Content-Length: 33
  &lt; ETag: W/&quot;21-35ITUmxJ2Do0aLZuKgJ4ee+3Kto&quot;
  &lt; Date: Wed, 12 Aug 2020 02:32:19 GMT
  &lt; Connection: keep-alive
  
  
  * Received 33 B chunk
  * Connection #21 to host localhost left intact
  </code></pre>
  <p>If anyone has any insight as to where my code is wrong in regard to my routes, it would be of great assistance.</p>
  <p>Thank you!</p>