Node.js 为什么中的无服务器端点URL不起作用?
我遵循了这一点 在AWS上设置无服务器框架。我成功地获得了cmd的终点。但当我在浏览器上点击端点url时,Json响应就像{“message”:“internalserver error”} 请检查我下面的代码,让我知道我哪里错了。 //index.jsNode.js 为什么中的无服务器端点URL不起作用?,node.js,api,serverless-framework,aws-serverless,Node.js,Api,Serverless Framework,Aws Serverless,我遵循了这一点 在AWS上设置无服务器框架。我成功地获得了cmd的终点。但当我在浏览器上点击端点url时,Json响应就像{“message”:“internalserver error”} 请检查我下面的代码,让我知道我哪里错了。 //index.js const serverless = require('serverless-http'); const express = require('express') const app = express() app.get('/', funct
const serverless = require('serverless-http');
const express = require('express')
const app = express()
app.get('/', function (req, res) {
res.send('Hello World!')
})
module.exports.handler = serverless(app);
//无血清
service: my-express-application
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: us-east-1
functions:
app:
handler: index.handler
events:
- http: ANY /
- http: 'ANY {proxy+}'
您可以转到cloudwatch查看更多特定日志您可以转到cloudwatch查看更多特定日志