내가 여기 설명서를 따라 지정된 응용 프로그램에 매핑되지 않습니다 : https://github.com/stormpath/express-stormpath오류 : 기본 계정 저장소는
오류 : 기본 계정 저장소가
내가 콘솔에서 위의 오류가 지정된 응용 프로그램에 매핑되지 않습니다 내 앱을 실행하려고 할 때. 이것이 내 코드의 문제 일 가능성이 있습니까? 아니면 Stormpath 사이트의 내 관리자 페이지로 이동해야합니까?
환경 변수를 설정하기 위해 windows 명령 setx를 사용했습니다. app.js 파일에 api 키와 비밀 키가있는 경우이를 수행해야하는지 확실하지 않습니다. 이 질문에 대해서는 XXXXXXXX와 (과) 관련이있는 중요한 정보가 삭제되었습니다.
var express = require('express');
var app = express();
//Stormpath
var stormpath = require('express-stormpath');
//Init Stormpath
app.use(stormpath.init(app, {
apiKey: {id:'XXXXXXXXXX', secret: 'XXXXXXXXXX'},
secretKey: 'random_string_of_words_go_here',
application: 'https://api.stormpath.com/v1/accounts/XXXXXXXXX'
}));
//home:
app.get('/', function(req, res){
res.render('home');
console.log(req.session);
});
app.get('/create-quiz', stormpath.loginRequired, function(req, res){
res.render('createQuiz');
});
//404 page:
app.use(function(req, res, next){
res.status(404);
res.render('404');
});
//500 page:
app.use(function(err, req, res, next){
console.error(err.stack);
res.status(500);
res.render('500');
});
app.on('stormpath.ready', function() {
console.log('Stormpath ready...')
});
app.listen(app.get('port'), function(){
console.log('Express started on http://localhost: ' + app.get('port') + '; Press ctrl-C to terminate.')
});
미리 도움을 청하십시오.
감사 에드워드! 내 디렉토리가 괜찮은 것으로 판명되었습니다. 그것은 내 apikey id, secret 및 application href에 "setx"대신 "set"을 사용한 후에 작동하기 시작했습니다. 제 질문을 읽고 디렉토리에 대한 통찰력을 제공 할 시간을내어 주셔서 감사합니다. –
쿨! 당신은에서 다음 코드를 얻을 않은 경우, 그냥 궁금 : {, '''app.use (stormpath.init (응용 프로그램 apiKey에 {ID : 'XXXXXXXXXX'비밀 'XXXXXXXXXX'}, 의 비밀 ' random_string_of_words_go_here ', 응용 프로그램 :'https://api.stormpath.com/v1/accounts/XXXXXXXXX ' }));''' 난 당신이 명시-stormpath를 구성하는 방식은 다음, 잘못된 생각합니다. 그것은 오래된 블로그 게시물/문서에서 왔을지라도? –
문서에서 응용 프로그램을 래핑하는 것처럼 보입니다 (아마도 응용 프로그램의 "계정 저장소"를 찾을 수없는 이유 일 것입니다) http://docs.stormpath.com/nodejs/express/latest/ configuration.html # inline-options –