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