serverless / examples

Serverless Examples – A collection of boilerplates and examples of serverless architectures built with the Serverless Framework on AWS Lambda, Microsoft Azure, Google Cloud Functions, and more.
https://www.serverless.com/examples/
Other
11.42k stars 4.47k forks source link

Serverless framework with Node ES6 modules #712

Open RobertSandiford opened 2 years ago

RobertSandiford commented 2 years ago

Hi,

I've just set up serverless with an aws/node/express template, and found that the template was using common JS. I haven't used CJS in quite a while, using ES6 modules instead. I haven't found much info at all on serverless and ES6 modules, so asking to what what the status on support is?

AWS supports ES6 modules, as I've created an AWS service with ESM before. But what I convert the template to ESM I get {"message":"Internal Server Error"} as a response from the home route (this route was working before).

Thanks in advance

marcodali commented 1 year ago

Yes it is possible to use ES6 modules or even better Typescript. If you want an example with the latest package versions visit this article http://medium.com/@durazno.marcodali/create-a-serverless-backend-for-your-new-project-with-lambda-dynamodb-and-typescript-in-a-couple-57b7a44b9a50