title: How to redirect to custom urls?
body: <p>I'm setting up an admin panel, and the admin enters his custom url in a textarea that stores in the db by clicking <code>enter</code>. Now I want to redirect him to the custom url that he entered already. How is that possible?
  In the below code how can I declare the <code>customURL</code>from database?</p>
  
  <pre><code>router.get('/blog/'+customURL, (req, res) =&gt; {
    MongoClient.connect(url, function(err, db) {
      if (err) throw err
      var dbo = db.db("barg")
      var query = { username: "a" }
      dbo.collection("post").find(query).toArray(function(err, result) {
        if (err) throw err
        console.log(result[0].url)
  
        res.render('blog',{
          post : result[0].content
        })
        db.close()
      })
    })
  })
  </code></pre>