typescript/kuzzle + elastic search

typescript 에서 kuzzle 로그인하기

노래하는 마케터 2019. 2. 25. 16:26
728x90
import Kuzzle from 'kuzzle-sdk/dist/kuzzle.js';

export class LoginPage implements OnInit {

kuzzle: any;
constructor() {}

ngOnInit() {
this.kuzzle = new Kuzzle('192.168.0.26', this.kuzzle_callback.bind(this));
} // .bind(this) : kuzzle 모듈 내부에 선언된 this와 바깥의 this를 동기화시킴.

kuzzle_callback (err, res) {
this.kuzzle.login('local', {username: 'kuzzle id', password: 'kuzzle password'}, '로그인 세션 유지 시간',
function(error, result) {
}); // 로그인 세션 유지 시간 = ex)1h, 18000 etc...
}



커즐 로그인하는 방식인데요 환경은 ionic + cordova + angular + typescript입니다.

728x90