Skip to content

Commit 1214546

Browse files
committed
Updated the vercel config for the server
1 parent 7187151 commit 1214546

File tree

4 files changed

+10
-21
lines changed

4 files changed

+10
-21
lines changed

app.js renamed to api/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ app.use(express.json())
3434
app.use(express.urlencoded({extended: false}))
3535

3636
// middleware for handling sample api routes
37-
app.use('/api/v1', require('./routes/api/v1/API'))
37+
app.use('/api/v1', require('../routes/api/v1/API'))
3838

3939
module.exports = app

bin/www renamed to bin/www.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
const app = require('../app')
3+
const app = require('../api/app')
44

55
// use port from environment variables for production
66
const PORT = process.env.PORT || 5000

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
"name": "coderatingengine",
33
"version": "1.0.0",
44
"engines": {
5-
"node": "16.x",
5+
"node": "18.x",
66
"yarn": "1.x"
77
},
88
"description": "Engine to handle the rating mechanisms for the clean code",
9-
"main": "bin/www",
9+
"main": "bin/www.js",
1010
"scripts": {
11-
"start": "node ./bin/www",
12-
"dev": "nodemon ./bin/www",
13-
"test": "mocha --exit --timeout 15000"
11+
"start": "node ./bin/www.js",
12+
"dev": "nodemon ./bin/www.js",
13+
"test": "mocha --exit --timeout 15000",
14+
"build": "yarn install"
1415
},
1516
"author": "Gaurav Walia",
1617
"license": "ISC",

vercel.json

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
{
2-
"version": 2,
32
"github": {
43
"enabled": false
54
},
6-
"builds":[
7-
{
8-
"src": "./bin/www",
9-
"use": "@vercel/node",
10-
"config": { "includeFiles": ["**"] }
11-
}
12-
],
13-
"routes":[
14-
{
15-
"src": "/(.*)",
16-
"dest": "bin/www"
17-
}
18-
]
5+
"rewrites": [{ "source": "/api/(.*)", "destination": "/api/app.js" }],
6+
"outputDirectory": "./api"
197
}

0 commit comments

Comments
 (0)