Question

the answer to this question must be so trivial because I can't find anything that spells it out for me. I'm trying to set up a database on cloudant but I keep hearing that to abide the same origin policy the html files will need to be hosted in the same location. How do I get my html files onto my cloudant domain?

I feel pretty stupid that I haven't been able to figure this out for myself.

Was it helpful?

Solution 2

As attachments.

Upload your files as attachments and then access them by going to https://you.cloudant.com/dbname/documentid/name_of_file.html.

Tools like erica (a bigger list of options here) will do that for you. With them, you just need to put all your HTML, CSS and JS files in a folder and the tool will save them all as attachments of a Design Document, then that bundle will become your Couchapp.

(After that you just have to mix some ajax calls to _views and pure docs with links to _list and _show functions -- if you want -- and you'll be a complete couchapper).

OTHER TIPS

You can host static sites on Cloudant similarly to CouchDB. Your best "Getting Started" resource is probably CouchApp.org which explains the mechanism and provides links to tooling which will help you bundle the assets together.

It's also worth mentioning that Cloudant now supports CORS so an externally hosted site is possible as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top