fix backend bug
This commit is contained in:
1 parent
f24f1755d4
commit
5cc21a51e1
4 files changed
+83
No files matched your search
@@ -0,0 +1,26 @@
|
||||
const http = require('http');
|
||||
|
||||
const data = JSON.stringify({
|
||||
id: "default_user", height: 175, weight: 70, age: 30, gender: "male",
|
||||
activityLevel: "light", goal: "maintain", bmi: 22.8, tdee: 2000,
|
||||
targetCalories: 2000, targetProtein: 100, targetFat: 50, targetCarbs: 250, targetWater: 2000
|
||||
});
|
||||
|
||||
const req = http.request({
|
||||
hostname: 'localhost',
|
||||
port: 3131,
|
||||
path: '/api/profile',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': Buffer.byteLength(data)
|
||||
}
|
||||
}, (res) => {
|
||||
let body = '';
|
||||
res.on('data', chunk => body += chunk);
|
||||
res.on('end', () => console.log('Response:', res.statusCode, body));
|
||||
});
|
||||
|
||||
req.on('error', e => console.error('Error:', e));
|
||||
req.write(data);
|
||||
req.end();
|
||||
Reference in new issue
Block a user