I am trying to deploy an existing node js application using serverless on AWS infrastructure.
my yaml is like :
service: todo-app-api
provider:
name: aws
runtime: nodejs10.x
functions:
app:
handler: server.run
events:
- http:
path: /
method: ANY
cors: false
- http:
path: /{proxy+}
method: ANY
cors: false
plugins:
- serverless-offline
SLS deploy works fine and it creates lambda and other resources well. But when invoking that getting internal server error, when I see aws logs it gives error details as
"errorType": "Error",
"errorMessage": "Unsupported framework",
"stack": [
"Error: Unsupported framework",
" at getFramework (/var/task/node_modules/serverless-http/lib/framework/get-framework.js:69:9)",
" at module.exports (/var/task/node_modules/serverless-http/serverless-http.js:14:21)",
" at Object.<anonymous> (/var/task/server.js:31:22)",
" at Module._compile (internal/modules/cjs/loader.js:778:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)",
" at Module.load (internal/modules/cjs/loader.js:653:32)",
" at tryModuleLoad (internal/modules/cjs/loader.js:593:12)",
" at Function.Module._load (internal/modules/cjs/loader.js:585:3)",
" at Module.require (internal/modules/cjs/loader.js:692:17)",
" at require (internal/modules/cjs/helpers.js:25:18)",
" at _tryRequire (/var/runtime/UserFunction.js:75:12)",
" at _loadUserApp (/var/runtime/UserFunction.js:95:12)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:45:30)",
" at Module._compile (internal/modules/cjs/loader.js:778:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)"
]
}
can somebody tell me if anything wrong I have done?
Thanks In Advance.
server.jsfile inside the same directory as yourserverless.yaml, and does it include a line likemodule.exports.run = (event, context, callback) => {? - Pat Needham