File size: 568 Bytes
f39c319 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import app from './src/index';
const PORT = 3001;
const BASE_URL = `http://localhost:${PORT}`;
const server = app.listen(PORT, async () => {
console.log('Server started on 3001');
try {
const res = await fetch(`${BASE_URL}/api/agents/peer-reg-summary`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
});
const data = await res.json();
console.log('res:', res.status, data);
} catch(e) {
console.log('err:', e);
}
server.close();
process.exit(0);
});
|