Created
October 16, 2015 11:13
-
-
Save tlvince/b4214358a84272bd46df to your computer and use it in GitHub Desktop.
Reduced test case for angular-eha.couchdb-auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html ng-app="test"> | |
<body> | |
<script src="https://cdn.jsdelivr.net/angularjs/1.4.6/angular.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/pouchdb/4.0.0/pouchdb.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/localforage/1.2.2/localforage.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/lodash/3.5.0/lodash.min.js"></script> | |
<script src="https://cdn.rawgit.com/nolanlawson/pouchdb-authentication/master/dist/pouchdb.authentication.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/restangular/1.4.0/restangular.min.js"></script> | |
<script src="https://cdn.rawgit.com/ocombe/angular-localForage/master/dist/angular-localForage.min.js"></script> | |
<script src="https://cdn.rawgit.com/eHealthAfrica/angular-eha.couchdb-auth/master/dist/couchdb-auth.min.js"></script> | |
<script> | |
angular.module('test', [ | |
'eha.couchdb-auth' | |
]) | |
.config(function(ehaCouchDbAuthServiceProvider) { | |
ehaCouchDbAuthServiceProvider.config({ | |
url: 'https://eha-auth-test.iriscouch.com' | |
}) | |
}) | |
.run(function(ehaCouchDbAuthService) { | |
ehaCouchDbAuthService.signIn({ | |
username: 'admin', | |
password: 'admin' | |
}) | |
.then(console.log.bind(console)) | |
.then(function() { | |
var db = new PouchDB('https://eha-auth-test.iriscouch.com/test') | |
return db.info() | |
}) | |
.then(console.log.bind(console)) | |
.catch(console.error.bind(console)) | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment