diff --git a/.gitignore b/.gitignore index 6124974..7668ea5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /node_modules/ /package-lock.json /.env +/.netlify/* +!/.netlify/functions /.vercel diff --git a/.netlify/functions/app/app.js b/.netlify/functions/app/app.js new file mode 100644 index 0000000..d58fd4b --- /dev/null +++ b/.netlify/functions/app/app.js @@ -0,0 +1,7 @@ +const awsServerlessExpress = require("aws-serverless-express"); +const app = require("../../../index.js"); +const server = awsServerlessExpress.createServer(app); + +exports.handler = (event, context) => { + awsServerlessExpress.proxy(server, event, context); +}; diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..3882d74 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,6 @@ +[build] + functions = ".netlify/functions" +[[redirects]] + from = "/*" + to = "/.netlify/functions/app" + status = 200 diff --git a/package.json b/package.json index 7439342..fa9c63e 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "start": "node -r dotenv/config index.js" }, "dependencies": { + "aws-serverless-express": "latest", "cookie-parser": "latest", "express": "latest", "morgan": "latest",