Posts

Showing posts with the label cors

CORS - Cross Origin Resource Sharing using CouchDB

Recently I tried to build a simple application which creates simple math questions, and records the time taken by the student to finish one page of questions. The short story is that I finally succeeded in implementing the question generation by using Javascript without any server side programming. But what about recording the time taken? We need some database in some server for that. I want to use a database, but I don't want to  code server-side. So I guess CouchDB is a good choice, given that it supports REST-based API and all. It turned out that calling HTTP REST service from  the browser is much more complicated than calling the same service from the server. To make a long story short, here is what I found : Javascript running in a page in a web browser are not allowed to call urls outside the domain of the page.  Except, when the server serving the URL specifically allowed this by giving Cross Origin Resource Sharing header. Credentials passing is doubly diff...