title: Having issues with javascript compiling
body: <p>I have an application Javascript file that is showing an error in the console section of VS Studio Code, it keeps saying: app.js: <strong>The parser expected to find a '}' to match the '{' token here.</strong> and the console will not compile.</p>
  
  <p>Based on my code, would you be able to tell me where I need to close in my braces? I think I might be confused.</p>
  
  <p>Here is my app.js code:</p>
  
  <pre><code>const express = require('express');
  const app = express();
  const bodyParser  = require('body-parser');
  const mongoose = require('mongoose');
  //specify where to find the schema
  const Item = require('./models/item')
  // connect and display the status 
  mongoose.connect('mongodb://localhost:27017/items', { useNewUrlParser: true })
    .then(() =&gt; { console.log("connected"); })
    .catch(() =&gt; { console.log("error connecting"); });
  
  // use the following code on any request that matches the specified mount path
  app.use((req, res, next) =&gt; {
     console.log('This line is always called');
     res.setHeader('Access-Control-Allow-Origin', '*'); //can connect from any host
     res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, OPTIONS'); //allowable methods
     res.setHeader('Access-Control-Allow-Headers', 'Origin, Content-Type, Accept');
     next();
  });
  app.get('/items', (req, res, next) =&gt; {
    //call mongoose method find (MongoDB db.Students.find())
    Item.find() 
      //if data is returned, send data as a response 
      .then(data =&gt; res.status(200).json(data))
      //if error, send internal server error
      .catch(err =&gt; {
      console.log('Error: ${err}');
      res.status(500).json(err);
  });
  
  
    // parse application/x-www-form-urlencoded
  app.use(bodyParser.urlencoded({ extended: false }))
  
  // parse application/json
  app.use(bodyParser.json())
  
  // serve incoming post requests to /items
  app.post('/items', (req, res, next) =&gt; {
      const items = req.body;
      console.log(items.itemName + " " + items.servings);
      //sent an acknowledgment back to caller 
      res.status(201).json('Post successful');
    });
  
  
  //to use this middleware in other parts of the application
  module.exports=app;
  </code></pre>