Skip to content

Commit 3c1a89c

Browse files
authored
Update app.js
1 parent 7bacf9b commit 3c1a89c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
const express = require('express');
22
const bodyParser = require('body-parser');
3+
const cors = require('cors');
34
const { exec } = require('child_process');
45
const path = require('path');
56
const fs = require('fs');
67

78
const app = express();
89
const PORT = 3000;
910

11+
// Middleware to enable CORS
12+
app.use(cors());
13+
1014
// Middleware to parse JSON
1115
app.use(bodyParser.json());
1216

@@ -45,7 +49,6 @@ app.post('/clone-repo', (req, res) => {
4549
if (fs.existsSync(repoPath)) {
4650
return res.status(400).json({
4751
error: 'Repo folder already exists.',
48-
repoUrl: `https://https://sch-ai1z.onrender.com/websites/${repoName}`,
4952
});
5053
}
5154

0 commit comments

Comments
 (0)