Created
August 5, 2021 15:59
-
-
Save redgeoff/b79c54aff1c8b4167a64561a09977dbd to your computer and use it in GitHub Desktop.
lambdaToExpress - express.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import cors from 'cors'; | |
import handler from './lambda'; | |
import lambdaToExpress from './lambda-to-express'; | |
const PORT = 3000; | |
const app = express(); | |
app.use(cors()); | |
app.use(express.json()); // Parse JSON bodies | |
app.put('/lead/:leadId', lambdaToExpress(handler)); | |
app.listen(PORT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment