Deploy to Vercel and Render
This commit is contained in:
@@ -1,10 +1,4 @@
|
|||||||
# Test Case Manager Backend
|
# TestPlat Backend
|
||||||
|
|
||||||
## Technologies
|
|
||||||
|
|
||||||
- Node.js
|
|
||||||
- Express
|
|
||||||
- SQLite
|
|
||||||
|
|
||||||
## Install dependencies
|
## Install dependencies
|
||||||
|
|
||||||
@@ -12,6 +6,14 @@
|
|||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Set Environmental variable
|
||||||
|
|
||||||
|
Create `.env` File
|
||||||
|
|
||||||
|
```
|
||||||
|
NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:3001
|
||||||
|
```
|
||||||
|
|
||||||
## Set up database
|
## Set up database
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ const app = express();
|
|||||||
|
|
||||||
// enable frontend access
|
// enable frontend access
|
||||||
const cors = require("cors");
|
const cors = require("cors");
|
||||||
|
const frontendOrigin = process.env.FRONTEND_ORIGIN || 'http://localhost:3000';
|
||||||
const corsOptions = {
|
const corsOptions = {
|
||||||
origin: "http://localhost:3000",
|
origin: frontendOrigin,
|
||||||
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
|
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
|
||||||
};
|
};
|
||||||
app.use(cors(corsOptions));
|
app.use(cors(corsOptions));
|
||||||
|
|||||||
40
docs/docs/getstarted/deployment.md
Normal file
40
docs/docs/getstarted/deployment.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 4
|
||||||
|
---
|
||||||
|
|
||||||
|
# Deployment
|
||||||
|
|
||||||
|
## Deploying to Vercel and Render
|
||||||
|
|
||||||
|
Deploy the frontend to Vercel and the backend to Render.
|
||||||
|
|
||||||
|
### Vercel Configuration
|
||||||
|
|
||||||
|
#### Environment Variables
|
||||||
|
|
||||||
|
|key|value|
|
||||||
|
|-|-|
|
||||||
|
|NEXT_PUBLIC_BACKEND_ORIGIN|`your backend server origin`|
|
||||||
|
|
||||||
|
#### Settings
|
||||||
|
|
||||||
|
|Settings|value|
|
||||||
|
|-|-|
|
||||||
|
|Root Directory|`frontend`|
|
||||||
|
|Framework Preset|`Next.js`|
|
||||||
|
|
||||||
|
### Render Configuration
|
||||||
|
|
||||||
|
#### Environment Variables
|
||||||
|
|
||||||
|
|key|value|
|
||||||
|
|-|-|
|
||||||
|
|FRONTEND_ORIGIN|`your frontend server origin`|
|
||||||
|
|
||||||
|
#### Settings
|
||||||
|
|
||||||
|
|Settings|value|
|
||||||
|
|-|-|
|
||||||
|
|Root Directory|`backend`|
|
||||||
|
|Build Command|`npm ci && npm run migrate && npm run seed`|
|
||||||
|
|Start Command|`npm run index`|
|
||||||
@@ -1,11 +1,4 @@
|
|||||||
# Test Case Manager Frontend
|
# TestPlat Frontend
|
||||||
|
|
||||||
## Technologies
|
|
||||||
|
|
||||||
- React
|
|
||||||
- Next.js
|
|
||||||
- Tailwind CSS
|
|
||||||
- NextUI
|
|
||||||
|
|
||||||
## Install dependencies
|
## Install dependencies
|
||||||
|
|
||||||
@@ -13,16 +6,16 @@
|
|||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Set Environmental variable
|
||||||
|
|
||||||
|
Create `.env` File
|
||||||
|
|
||||||
|
```
|
||||||
|
NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:3001
|
||||||
|
```
|
||||||
|
|
||||||
## Run the development server
|
## Run the development server
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
## Edit Environmental variable
|
|
||||||
|
|
||||||
Create `.env` File
|
|
||||||
|
|
||||||
```
|
|
||||||
NEXT_PUBLIC_API_SERVER=http://localhost:3001
|
|
||||||
```
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
const Config = {
|
const Config = {
|
||||||
apiServer: process.env.NEXT_PUBLIC_API_SERVER || 'http://localhost:3001',
|
apiServer: process.env.NEXT_PUBLIC_BACKEND_ORIGIN || 'http://localhost:3001',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Config;
|
export default Config;
|
||||||
Reference in New Issue
Block a user