A comprehensive Node.js web application for testing different API endpoints with various parameters and getting detailed responses. Built with Express.js and EJS templating engine.
- Multiple HTTP Methods: Support for GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS
- Dynamic Headers: Add custom headers for authentication, content-type, etc.
- Query Parameters: Test endpoints with various query string parameters
- Request Body: Support for JSON, form-data, XML, and plain text
- Response Analysis: View response body, headers, and request information
- Performance Metrics: Response time tracking and status codes
- Request History: Save and view previous API calls
- Export Options: Copy responses and download results
- Responsive Design: Works on desktop and mobile devices
- Security Features: Rate limiting, CORS, and security headers
-
Clone or download the project files
-
Install dependencies:
npm install
-
Start the application:
# Development mode with auto-reload npm run dev # Production mode npm start
-
Open your browser and navigate to:
http://localhost:3000
api-testing-dashboard/
├── server.js # Main Express server
├── package.json # Dependencies and scripts
├── views/
│ └── dashboard.ejs # Main dashboard template
├── public/
│ ├── css/
│ │ └── style.css # Dashboard styling
│ └── js/
│ └── dashboard.js # Frontend functionality
└── README.md # This file
- Select HTTP Method: Choose from GET, POST, PUT, PATCH, DELETE, HEAD, or OPTIONS
- Enter URL: Provide the complete API endpoint URL
- Set Timeout: Configure request timeout (default: 30 seconds)
- Add Headers: Include custom headers like Authorization, Content-Type, etc.
- Query Parameters: Add URL query parameters if needed
- Request Body: For POST/PUT requests, enter the request body content
- Send Request: Click "Send Request" to test the API
- Headers Management: Add/remove custom headers dynamically
- Parameter Testing: Test with various query parameters
- Content Types: Support for JSON, form-data, XML, and plain text
- Response Analysis: View response in multiple tabs (Body, Headers, Request Info)
- Export Options: Copy responses to clipboard or download as files
- Request History: Automatically saves all API calls for reference
Method: GET
URL: https://jsonplaceholder.typicode.com/posts/1
Headers: Accept: application/json
Method: POST
URL: https://jsonplaceholder.typicode.com/posts
Headers: Content-Type: application/json
Body: {"title": "Test Post", "body": "This is a test", "userId": 1}
Method: GET
URL: https://api.github.com/user
Headers: Authorization: Bearer YOUR_TOKEN
Create a .env
file in the root directory:
PORT=3000
NODE_ENV=development
- Port: Change the default port in
server.js
or via environment variable - Rate Limiting: Modify rate limit settings in
server.js
- CORS: Adjust CORS settings for your deployment environment
- Security Headers: Customize Helmet.js security settings
GET /
- Main dashboard interface
POST /api/test
- Execute API requestsGET /api/history
- Get request history (placeholder)
- Helmet.js: Security headers for protection against common vulnerabilities
- Rate Limiting: Prevents abuse with configurable request limits
- CORS: Configurable Cross-Origin Resource Sharing
- Input Validation: Server-side validation of all inputs
- Error Handling: Comprehensive error handling and logging
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
- Port already in use: Change the PORT in
.env
or kill the process using the port - CORS errors: Ensure your target API allows requests from your domain
- Timeout errors: Increase the timeout value for slow APIs
- JSON parsing errors: Verify your request body is valid JSON
Enable debug logging by setting:
NODE_ENV=development npm run dev
- Frontend: Modify
views/dashboard.ejs
andpublic/js/dashboard.js
- Backend: Extend
server.js
with new routes and functionality - Styling: Update
public/css/style.css
for UI changes
Run the test suite:
npm test
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
For issues and questions:
- Check the troubleshooting section
- Review the code comments
- Open an issue on the repository
Happy API Testing! 🚀