You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo demonstrates how to use . It is kept up to date with that release version of the package. For a demo which is kept in sync with the master branch of elm-serverless see the demo embedded in that repo
Run locally
We use serverless-offline to run the server locally during development. To get started, clone this repo and then:
npm install
npm start
Which will start a server listening on port 3000. Note that the demo includes multiple, independent, elm-serverless programs which are deployed as a bundle. Each program contains:
API.elm - the main entry point of the Elm HTTP API
api.js - a small bridge from JavaScript to Elm
Learn by reading the demos in the following order:
Setup AWS_REGION, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY in your environment. Make sure you have sufficient permissions to perform a serverless deployment (either admin rights, or something more restricted). Then npm run deploy:demo. If all goes well you'll see something like this in the output:
endpoints:
ANY - https://***.execute-api.us-east-1.amazonaws.com/dev/
ANY - https://***.execute-api.us-east-1.amazonaws.com/dev/{proxy+}
Call the first endpoint to test your deployed function.
How it works
Two tools are involved in getting your elm app on AWS Lambda: