Skip to content

Commit c05c463

Browse files
authored
Merge pull request #130 from sdjcw/master
fix: 云函数独立运行时,增加 `/` 路由,用来通过云引擎健康检查
2 parents a6206d4 + c84fbd3 commit c05c463

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/cloud.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ Cloud.start = function() {
220220
masterKey: process.env.LEANCLOUD_APP_MASTER_KEY,
221221
});
222222
}
223-
server = AV.express().listen(PORT, function() {
223+
const app = AV.express();
224+
app.use('/', function(req, res) {
225+
res.end('This is a LeanEngine application.');
226+
});
227+
server = app.listen(PORT, function() {
224228
console.log('LeanEngine Cloud Functions app is running, port:', PORT);
225229
});
226230
};

0 commit comments

Comments
 (0)