Browse Source

Hack to make Vercel include view in build

master
Luke Childs 2 years ago
parent
commit
d8008b46f6
  1. 1
      .gitignore
  2. 1
      api/index.js
  3. 2
      index.js
  4. 18
      vercel.json

1
.gitignore

@ -70,3 +70,4 @@ Icon
Network Trash Folder
Temporary Items
.apdisk
.vercel

1
api/index.js

@ -0,0 +1 @@
require('../index.js')

2
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}`));

18
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"
}
]
}
}
}
Loading…
Cancel
Save