node.js에 기본 keystone.js 초보자 응용 프로그램을 Azure 웹 사이트의 공유 계층에 배포하려고합니다.웹 사이트 배포시 Azure keystone.js에 오류가 발생했습니다.
는 내가 주 서버 파일이 keystone.js
그래서 난 index.js
에 이름이 불렸다 있기 때문에 될 줄 알았는데
The page cannot be displayed because an internal server error has occurred.
배포 후 오류를 얻고있다. 이것은 그것을 고칠 didnt.
다음은 키스톤이 포트 3000으로 기본 설정되어 있으므로 내 index.js
파일의 포트 정보를 추가했기 때문에 문제가 될 수 있다고 생각했습니다. 여기에 있습니다 :
// Simulate config options from your production environment by
// customising the .env file in your project's root folder.
require('dotenv').load();
// Require keystone
var keystone = require('keystone');
// Initialise Keystone with your project's configuration.
// See http://keystonejs.com/guide/config for available options
// and documentation.
keystone.init({
'name': 'Magic Site',
'brand': 'Magic Site',
'less': 'public',
'static': 'public',
'favicon': 'public/favicon.ico',
'views': 'templates/views',
'view engine': 'jade',
'mongo': "redacted",
'port': process.env.PORT || 1337,
'auto update': true,
'session': true,
'auth': true,
'user model': 'User',
'cookie secret': 'redacted'
});
// Load your project's Models
keystone.import('models');
// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js
keystone.set('locals', {
_: require('underscore'),
env: keystone.get('env'),
utils: keystone.utils,
editable: keystone.content.editable
});
// Load your project's Routes
keystone.set('routes', require('./routes'));
// Setup common locals for your emails. The following are required by Keystone's
// default email templates, you may remove them if you're using your own.
// Configure the navigation bar in Keystone's Admin UI
keystone.set('nav', {
'posts': ['posts', 'post-categories'],
'galleries': 'galleries',
'enquiries': 'enquiries',
'users': 'users'
});
// Start Keystone to connect to your database and initialise the web server
keystone.start();
아직 운이 없습니다. 그러나 이것은 Azure가 아닌 내 로컬 컴퓨터에서 잘 작동합니다. 어떤 아이디어?
업데이트 : 메인 서버 파일을 "server.js"로 업데이트했습니다. 내가 뒷조사를했고, 푸른에 배포 로그를 보면서 이걸 발견 :
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling node.js deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Deleting file: 'index.js'
Copying file: 'package.json'
Copying file: 'server.js'
Using start-up script server.js from package.json.
Generated web.config.
Node.js versions available on the platform are: 0.6.17, 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29.
Selected node.js version 0.10.29. Use package.json file to choose a different version.
Updating iisnode.yml at D:\home\site\wwwroot\iisnode.yml
Finished successfully.
프로젝트를 하늘빛에 업로드 한 방법은 무엇입니까? Kudu를 사용 했습니까? 또는 FTP를 사용하여 컨텐츠를 복사 했습니까? index.js 또는 keystone.js와 같은 기본 스크립트를 가리 키도록 iisnode를 구성하려면 web.config가 필요합니다. 로컬 컴퓨터에서 iisnode로이 응용 프로그램을 사용해 보셨습니까? –
@RanjithRamachandra Bitbucket에 소스 코드가 있고 Azure 웹 사이트 "소스 제어에서 배포"옵션을 사용하고 있습니다. 나는 iisnode를 사용하지 않았기 때문에 Mac에서 내 개발자를하고 있습니다. 프로젝트에 web.config 파일을 어디에 두어야하며 어디에 넣어야합니까? – RandomDeduction
위 로그에서 Kudu가 자동으로 web.config를 작성해야합니다. 나는 이것을 직접 시험해보고 나의 결과를 알려준다. Btw, 어디서 데이터베이스를 구성 했습니까? –