| 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); | |
| }); | |