-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Davenport's use is ok in ES5 Browser when transpiled? #1
Comments
Hey @bradws, as far as I know Davenport should be usable in the browser, although I haven't personally tested it and only use it in Node. I'll try to get this figured out and add something to the readme for it. Off the top of my head, the first thing I would do is make sure Davenport is definitely being loaded into your web page. |
Alright, I've looked a little closer and Davenport can definitely work in the browser. I've added a browser-specific build to the NPM package, you'll find it under node_modules/davenport/bin/browser.js, but you can also just continue to require it like normal as long as you're using a bundler like webpack or browserify. The biggest problem that I ran into when using Davenport in the browser was related to CORS. I had to configure my CouchDB installation to allow CORS before Davenport was able to connect. You can find the CORS option at localhost:5984/_utils, in the configuration menu. |
Hi again, I'm still struggling to get Davenport working in Angular in the Browser. I'm using SystemJS. But I can't even get it working in the browser at all: It cannot see 'Client' nor 'Davenport'. Can you provide some simple code examples at all? |
No problem! I'll try to get some example files into the repo as soon as I get a chance. |
Hi there,
I have this working in Node v6 (using the Async/Await, etc) just fine, however I'm getting a 'GET http://localhost:3000/davenport 404 (Not Found)' error and a 'ZoneAwareError' in Chrome browser (I'm using Angular 2.4). Is Davenport ok to work in the ES5 browser?
I'm using Typescript 2.1 and can confirm the normal Async/Await feature is working in the browser. However, whenever I put this
getMessage
function in a class:Typescript builds just fine, but the errors appear in the browser when I put the
const client = new Client<Foo>('http://127.0.0.1:5984', 'hello-world');
line in there.It can't seem to find Davenport. Maybe, are you able to provide some example code at all?
Cheers,
bradws
The text was updated successfully, but these errors were encountered: