-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdeploy.js
More file actions
34 lines (29 loc) Β· 1.05 KB
/
deploy.js
File metadata and controls
34 lines (29 loc) Β· 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Deployment script for Vesting Vault Backend
const { exec } = require('child_process');
console.log('π Starting deployment process...');
// Install dependencies
exec('npm install', (error, stdout, stderr) => {
if (error) {
console.error('β npm install failed:', error);
return;
}
console.log('β
Dependencies installed');
// Start the server
console.log('π Starting Vesting Vault API...');
const server = exec('node index.js', (error, stdout, stderr) => {
if (error) {
console.error('β Server start failed:', error);
return;
}
console.log('β
Server is running!');
console.log('π Portfolio endpoint: http://localhost:3000/api/user/:address/portfolio');
console.log('π§ͺ Test with: node test-endpoint.js');
});
// Handle server output
server.stdout.on('data', (data) => {
console.log(data.toString());
});
server.stderr.on('data', (data) => {
console.error('Error:', data.toString());
});
});