A web-based tool to quickly generate and serve custom API endpoints using a simple UI. Define endpoints, methods, and responses, and the backend will serve them instantly—no coding required!
- Dynamic API Creation: Add multiple endpoints with custom methods and responses.
- Supports GET & POST: Define GET (JSON or text response) and POST (JSON schema) endpoints.
- Persistent Storage: Endpoints are saved in
urls.jsonand persist across server restarts. - Live Feedback: User-friendly error messages for invalid input.
- View All Endpoints: Easily view all configured endpoints via
/endpoints.
- Node.js (v14+ recommended)
- npm (comes with Node.js)
-
Clone the repository:
git clone <your-repo-url> cd automatic-api-generater/Automatic-API-Generator
-
Install dependencies:
npm install
-
Start the server:
npm start
The server will run on http://localhost:8000.
-
Open the app:
Go to http://localhost:8000 in your browser. -
Configure endpoints:
- Enter the number of endpoints you want to create.
- For each endpoint, specify:
- Endpoint Name: (e.g.,
/api/users) - HTTP Method:
GETorPOST - Response Data:
- For GET: Enter JSON or plain text (e.g.,
{"msg": "Hello"}orHello World) - For POST: Enter a JSON schema (e.g.,
{"username": "string", "age": "number"})
- For GET: Enter JSON or plain text (e.g.,
- Endpoint Name: (e.g.,
-
Generate API:
Click "⚡ Generate API Configuration".- Success and error messages will be shown for feedback.
- Endpoints are saved to
urls.json.
-
Test your endpoints:
- Use tools like Postman, curl, or your browser to hit your custom endpoints.
- Example:
curl http://localhost:8000/api/users
-
View all endpoints:
Visit http://localhost:8000/endpoints to see all configured endpoints.
Automatic-API-Generator/
├── app.js # Main Express server
├── urls.json # Stores all user-defined endpoints
├── package.json # Project metadata and dependencies
└── public/
├── index.html # Main UI
├── scripts.js # Frontend logic
└── styles.css # UI styles
- If you send invalid JSON to the backend, you'll get:
{ "success": false, "error": "Invalid JSON: Please send a valid JSON body." } - The UI provides live feedback for JSON validation and server errors.
- You can extend supported HTTP methods by editing the frontend and backend.
- To reset all endpoints, clear the
urls.jsonfile.
ISC
- Utkarsh Sharma