Deploy to Vercel and Render
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
# Test Case Manager Backend
|
||||
|
||||
## Technologies
|
||||
|
||||
- Node.js
|
||||
- Express
|
||||
- SQLite
|
||||
# TestPlat Backend
|
||||
|
||||
## Install dependencies
|
||||
|
||||
@@ -12,6 +6,14 @@
|
||||
npm install
|
||||
```
|
||||
|
||||
## Set Environmental variable
|
||||
|
||||
Create `.env` File
|
||||
|
||||
```
|
||||
NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:3001
|
||||
```
|
||||
|
||||
## Set up database
|
||||
|
||||
```bash
|
||||
|
||||
@@ -5,8 +5,9 @@ const app = express();
|
||||
|
||||
// enable frontend access
|
||||
const cors = require("cors");
|
||||
const frontendOrigin = process.env.FRONTEND_ORIGIN || 'http://localhost:3000';
|
||||
const corsOptions = {
|
||||
origin: "http://localhost:3000",
|
||||
origin: frontendOrigin,
|
||||
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
|
||||
};
|
||||
app.use(cors(corsOptions));
|
||||
|
||||
Reference in New Issue
Block a user