1
我尝试一些实践上谷歌云平台,App Engine的具体。应用引擎部署的NodeJS错误
同样,我创建了一个简单的nodejs应用程序,它只在响应中发送Hello Wold消息。
下面是我的文件:
aap.yaml
runtime: nodejs
env: flex
index.js
'use strict';
const http = require('http');
const port = 443;
const requestHandler = (request, response) => {
console.log(request.url);
response.end('Hello Node.js Server!');
}
const server = http.createServer(requestHandler);
server.listen(port, (err) => {
if (err) {
return console.log('something bad happened', err)
}
console.log(`server is listening on ${port}`)
});
的package.json
{
"name": "test-pro-for-gcm",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"deploy": "gcloud app deploy",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
更新1 在GCP日志,16:31:59.000 server is listening on 443
嘿,自从周六以来,我一直有同样的错误。将在这里观看线索,希望我们得到一个反馈。 –
我从我自己创建了这个应用程序,并且出现错误。现在我正在部署hello-world演示应用程序,并按预期工作。您可以从这里下载演示https://codeload.github.com/GoogleCloudPlatform/nodejs-docs-samples/zip/master – dearvivekkumar