You should use server-side infrastructure like hapijs, expressjs etc. where you should establish a connection by specifying your database url like
`MongoDB: // username: password@ds012367.mlab.com : 12367 / DbName
which then connects your application to the database.
source share