Update server.js
Browse files
server.js
CHANGED
|
@@ -66,30 +66,30 @@ app.post("/api/market-research", (req, res) => {
|
|
| 66 |
|
| 67 |
// Return mock response for testing
|
| 68 |
const mockResponse = {
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
marketSegments: [
|
| 77 |
-
{
|
| 78 |
-
segment: "Primary Segment",
|
| 79 |
-
segment_marketShare_2023: "35%",
|
| 80 |
-
segment_marketShare_2025: "38%",
|
| 81 |
-
segment_marketShare_2033: "42%",
|
| 82 |
-
segment_cagr: "12%"
|
| 83 |
}
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
{
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
| 89 |
}
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
};
|
| 94 |
|
| 95 |
console.log('Returning mock response');
|
|
@@ -115,32 +115,67 @@ app.post("/run", (req, res) => {
|
|
| 115 |
|
| 116 |
console.log('Processing /run request for task:', task, 'keyword:', keyword);
|
| 117 |
|
| 118 |
-
// Return mock response in the format n8n expects
|
| 119 |
const mockResponse = {
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
},
|
| 127 |
-
|
| 128 |
-
{
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
}
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
};
|
| 145 |
|
| 146 |
console.log('Returning mock response from /run');
|
|
|
|
| 66 |
|
| 67 |
// Return mock response for testing
|
| 68 |
const mockResponse = {
|
| 69 |
+
dashboard_view: {
|
| 70 |
+
marketTitle: `Global ${keyword} Market Analysis`,
|
| 71 |
+
marketSummary: {
|
| 72 |
+
past2023: 10.5,
|
| 73 |
+
current2025: 15.2,
|
| 74 |
+
forecast2033: 28.7,
|
| 75 |
+
cagr: 12.5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
| 77 |
+
},
|
| 78 |
+
report_view: {
|
| 79 |
+
marketTitle: `Global ${keyword} Market Analysis`,
|
| 80 |
+
marketOverview: {
|
| 81 |
+
pastYear_2023: 10.5,
|
| 82 |
+
currentYear_2025: 15.2,
|
| 83 |
+
forecastYear_2033: 28.7,
|
| 84 |
+
global_cagr_Forecast: 12.5
|
| 85 |
}
|
| 86 |
+
},
|
| 87 |
+
meta: {
|
| 88 |
+
job_id: `job_${Date.now()}`,
|
| 89 |
+
keyword: keyword,
|
| 90 |
+
timestamp: new Date().toISOString(),
|
| 91 |
+
status: "completed"
|
| 92 |
+
}
|
| 93 |
};
|
| 94 |
|
| 95 |
console.log('Returning mock response');
|
|
|
|
| 115 |
|
| 116 |
console.log('Processing /run request for task:', task, 'keyword:', keyword);
|
| 117 |
|
| 118 |
+
// Return mock response in the format n8n workflow expects
|
| 119 |
const mockResponse = {
|
| 120 |
+
dashboard_view: {
|
| 121 |
+
marketTitle: `Global ${keyword} Market Analysis`,
|
| 122 |
+
marketSummary: {
|
| 123 |
+
past2023: 10.5,
|
| 124 |
+
current2025: 15.2,
|
| 125 |
+
forecast2033: 28.7,
|
| 126 |
+
cagr: 12.5
|
| 127 |
+
},
|
| 128 |
+
forecast: [
|
| 129 |
+
{ year: "2023", value: 10.5 },
|
| 130 |
+
{ year: "2025", value: 15.2 },
|
| 131 |
+
{ year: "2033", value: 28.7 }
|
| 132 |
+
],
|
| 133 |
+
marketSegments: [
|
| 134 |
+
{
|
| 135 |
+
segment: "Primary Segment",
|
| 136 |
+
segment_marketShare_2023: "35%",
|
| 137 |
+
segment_marketShare_2025: "38%",
|
| 138 |
+
segment_marketShare_2033: "42%",
|
| 139 |
+
segment_cagr: "12%"
|
| 140 |
+
}
|
| 141 |
+
],
|
| 142 |
+
competitive: [
|
| 143 |
+
{
|
| 144 |
+
company: "Leading Company",
|
| 145 |
+
share: 25
|
| 146 |
+
}
|
| 147 |
+
]
|
| 148 |
},
|
| 149 |
+
report_view: {
|
| 150 |
+
marketTitle: `Global ${keyword} Market Analysis`,
|
| 151 |
+
marketOverview: {
|
| 152 |
+
pastYear_2023: 10.5,
|
| 153 |
+
currentYear_2025: 15.2,
|
| 154 |
+
forecastYear_2033: 28.7,
|
| 155 |
+
global_cagr_Forecast: 12.5
|
| 156 |
+
},
|
| 157 |
+
marketSegments: [
|
| 158 |
+
{
|
| 159 |
+
segment: "Primary Segment",
|
| 160 |
+
segment_marketShare_2023: "35%",
|
| 161 |
+
segment_marketShare_2025: "38%",
|
| 162 |
+
segment_marketShare_2033: "42%",
|
| 163 |
+
segment_cagr: "12%"
|
| 164 |
+
}
|
| 165 |
+
],
|
| 166 |
+
competitiveLandscape: [
|
| 167 |
+
{
|
| 168 |
+
company: "Leading Company",
|
| 169 |
+
player_marketShare_2025: 25
|
| 170 |
+
}
|
| 171 |
+
]
|
| 172 |
+
},
|
| 173 |
+
meta: {
|
| 174 |
+
job_id: `job_${Date.now()}`,
|
| 175 |
+
keyword: keyword,
|
| 176 |
+
timestamp: new Date().toISOString(),
|
| 177 |
+
status: "completed"
|
| 178 |
+
}
|
| 179 |
};
|
| 180 |
|
| 181 |
console.log('Returning mock response from /run');
|