From d8008b46f696bf71223e8992dc48bff81d1464f2 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Sat, 21 Jan 2023 09:53:00 +0000 Subject: [PATCH] Hack to make Vercel include view in build --- .gitignore | 1 + api/index.js | 1 + index.js | 2 +- vercel.json | 18 ++++++------------ 4 files changed, 9 insertions(+), 13 deletions(-) create mode 100644 api/index.js diff --git a/.gitignore b/.gitignore index 635b656..7897b82 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,4 @@ Icon Network Trash Folder Temporary Items .apdisk +.vercel diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..aaa55cd --- /dev/null +++ b/api/index.js @@ -0,0 +1 @@ +require('../index.js') \ No newline at end of file diff --git a/index.js b/index.js index 1a8baa8..5c0285e 100644 --- a/index.js +++ b/index.js @@ -40,4 +40,4 @@ app.use(controllers.error404); app.use(controllers.error); // Start app -app.listen(port, () => console.log(`Onionite listening on port ${port}`)); +app.listen(port, () => console.log(`Onionite listening on port ${port}`)); \ No newline at end of file diff --git a/vercel.json b/vercel.json index 5ff9f47..50beddc 100644 --- a/vercel.json +++ b/vercel.json @@ -1,14 +1,8 @@ { - "builds": [ - { - "src": "index.js", - "use": "@vercel/node" + "rewrites": [{ "source": "/(.*)", "destination": "/api" }], + "functions": { + "api/index.js": { + "includeFiles": "views/*" } - ], - "routes": [ - { - "src": "/(.*)", - "dest": "index.js" - } - ] - } \ No newline at end of file + } +} \ No newline at end of file