74 lines
1.7 KiB
Markdown
74 lines
1.7 KiB
Markdown
# Starting the Development Server
|
|
|
|
## Quick Start
|
|
|
|
1. **Start the server:**
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
2. **Wait for startup message:**
|
|
```
|
|
DBIS Core Lite server started on port 3000
|
|
Terminal UI: http://localhost:3000
|
|
```
|
|
|
|
3. **Access the terminal:**
|
|
- Open browser: http://localhost:3000
|
|
- The IBM 800 Terminal UI will load
|
|
|
|
## Troubleshooting
|
|
|
|
### Connection Refused Error
|
|
|
|
If you see `ERR_CONNECTION_REFUSED`:
|
|
|
|
1. **Check if server is running:**
|
|
```bash
|
|
lsof -i :3000
|
|
# or
|
|
netstat -tuln | grep 3000
|
|
```
|
|
|
|
2. **Check for errors in terminal:**
|
|
- Look for database connection errors
|
|
- Check configuration validation errors
|
|
- Verify JWT_SECRET is set (minimum 32 characters)
|
|
|
|
3. **Verify database is running:**
|
|
```bash
|
|
psql -U postgres -d dbis_core -c "SELECT 1;"
|
|
```
|
|
|
|
4. **Check environment variables:**
|
|
- Create `.env` file if needed
|
|
- Ensure `DATABASE_URL` is correct
|
|
- Ensure `JWT_SECRET` is at least 32 characters
|
|
|
|
### Common Issues
|
|
|
|
- **Database connection failed**: Ensure PostgreSQL is running and accessible
|
|
- **Configuration validation failed**: Check JWT_SECRET length (min 32 chars)
|
|
- **Port already in use**: Change PORT in .env or kill existing process
|
|
|
|
## Environment Variables
|
|
|
|
Create a `.env` file with:
|
|
|
|
```env
|
|
NODE_ENV=development
|
|
PORT=3000
|
|
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/dbis_core
|
|
JWT_SECRET=your-secret-key-must-be-at-least-32-characters-long
|
|
```
|
|
|
|
## Server Endpoints
|
|
|
|
Once running:
|
|
- **Terminal UI**: http://localhost:3000
|
|
- **API**: http://localhost:3000/api/v1
|
|
- **Swagger Docs**: http://localhost:3000/api-docs
|
|
- **Health Check**: http://localhost:3000/health
|
|
- **Metrics**: http://localhost:3000/metrics
|
|
|