Skip to content

Commit

Permalink
使用长前缀的环境变量
Browse files Browse the repository at this point in the history
  • Loading branch information
jysperm committed May 6, 2016
1 parent c8d2a52 commit c40a56a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
var AV = require('leanengine');

AV.init({
appId: process.env.LC_APP_ID,
appKey: process.env.LC_APP_KEY,
masterKey: process.env.LC_APP_MASTER_KEY
appId: process.env.LEANCLOUD_APP_ID,
appKey: process.env.LEANCLOUD_APP_KEY,
masterKey: process.env.LEANCLOUD_APP_MASTER_KEY
});

// 如果不希望使用 masterKey 权限,可以将下面一行删除
AV.Cloud.useMasterKey();

var app = require('./app');

// 端口一定要从环境变量 `LC_APP_PORT` 中获取。
// 端口一定要从环境变量 `LEANCLOUD_APP_PORT` 中获取。
// LeanEngine 运行时会分配端口并赋值到该变量。
var PORT = parseInt(process.env.LC_APP_PORT || 3000);
var PORT = parseInt(process.env.LEANCLOUD_APP_PORT || 3000);
app.listen(PORT, function () {
console.log('Node app is running, port:', PORT);
});

0 comments on commit c40a56a

Please sign in to comment.