Access database content from a web page using Javascript and CORS

Getting data from a database is traditionally done from server to server. With Javascript and CORS it's now easy to enhance web pages with dynamic content executed on the client. The growing trend of Single Page Applications(SPA) makes client side database access an important skillset to master.