From 3cbbc22867aec7f9462103eb1f2b77fd475f186c Mon Sep 17 00:00:00 2001 From: lizheming Date: Sun, 2 Apr 2023 00:18:46 +0800 Subject: [PATCH] chore: update --- .gitignore | 3 +++ netlify.toml | 2 ++ index.js => netlify/functions/comment.js | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 netlify.toml rename index.js => netlify/functions/comment.js (89%) diff --git a/.gitignore b/.gitignore index 6704566..6cd08c5 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,6 @@ dist # TernJS port file .tern-port + +# Local Netlify folder +.netlify diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..89824eb --- /dev/null +++ b/netlify.toml @@ -0,0 +1,2 @@ +[functions] + directory = "netlify/functions/" \ No newline at end of file diff --git a/index.js b/netlify/functions/comment.js similarity index 89% rename from index.js rename to netlify/functions/comment.js index 4e3b3b3..8405d68 100644 --- a/index.js +++ b/netlify/functions/comment.js @@ -1,3 +1,5 @@ +process.env.DETA_RUNTIME = 'true'; + const http = require('http'); const Waline = require('@waline/vercel'); const serverless = require('serverless-http'); @@ -8,5 +10,4 @@ const app = Waline({ }, }); - module.exports.handler = serverless(http.createServer(app)); \ No newline at end of file