Skip to content

Commit d85b5ad

Browse files
committed
fix backend url
1 parent d1f0aeb commit d85b5ad

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

mongodb-rag-docs/src/components/ChatbotInterface/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default function ChatbotInterface() {
128128

129129
try {
130130
// Call API with session support
131-
const response = await fetch('http://localhost:3001/api/chat', {
131+
const response = await fetch('https://mongodb-rag-docs-backend.vercel.app/api/chat', {
132132
method: 'POST',
133133
headers: { 'Content-Type': 'application/json' },
134134
body: JSON.stringify({

release-alpha.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env node
2+
3+
import fs from "fs";
4+
import { execSync } from "child_process";
5+
6+
// Helper function to run shell commands
7+
function runCommand(command) {
8+
try {
9+
execSync(command, { stdio: "inherit" });
10+
} catch (error) {
11+
console.error(`❌ Error running command: ${command}`);
12+
process.exit(1);
13+
}
14+
}
15+
16+
// Read package.json and increment the alpha version
17+
async function getNextAlphaVersion() {
18+
const packageJsonPath = "./package.json";
19+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
20+
21+
let currentVersion = packageJson.version;
22+
const match = currentVersion.match(/^(\d+\.\d+\.\d+)(-alpha\.(\d+))?$/);
23+
24+
if (!match) {
25+
console.error("❌ Invalid version format in package.json.");
26+
process.exit(1);
27+
}
28+
29+
let baseVersion = match[1];
30+
let alphaNumber = match[3] ? parseInt(match[3]) + 1 : 0;
31+
let newVersion = `${baseVersion}-alpha.${alphaNumber}`;
32+
33+
// Update package.json with new version
34+
packageJson.version = newVersion;
35+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
36+
37+
console.log(`🔹 Updated package.json to version: ${newVersion}`);
38+
return newVersion;
39+
}
40+
41+
// Main release process
42+
async function releaseAlpha() {
43+
console.log("🚀 Starting Alpha Release Process...");
44+
45+
// Ensure the working directory is clean
46+
runCommand("git status");
47+
48+
// Get next alpha version
49+
const newVersion = await getNextAlphaVersion();
50+
51+
// Commit changes
52+
runCommand("git add package.json");
53+
runCommand(`git commit -m "Bump version to ${newVersion}"`);
54+
55+
// Create a git tag
56+
runCommand(`git tag -a ${newVersion} -m "Alpha release for ${newVersion}"`);
57+
runCommand("git push origin --tags");
58+
59+
// Publish to npm with alpha tag
60+
runCommand("npm publish --tag alpha");
61+
62+
console.log(`✅ Alpha release ${newVersion} published successfully!`);
63+
}
64+
65+
// Execute the release function
66+
releaseAlpha();

0 commit comments

Comments
 (0)