The DevTools Companion API is a Node.js Express application that provides endpoints for various developer tools, including color conversion, JSON manipulation, Markdown rendering, and more.
To run the DevTools Companion API locally, follow these steps:
-
Clone the repository:
git clone https://github.com/zahidhasann88/devtools-companion.git cd devtools-companion
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory with the following environment variables:PORT=5000 MONGODB_URI=mongodb://localhost:27017/devtools
Adjust
MONGODB_URI
as per your MongoDB setup. -
Start the server:
npm start
The API server will start running at
http://localhost:5000
.
Once the server is running, you can use tools like Postman or curl to interact with the API endpoints. Make sure to refer to the Endpoints section below for detailed information on available routes and their usage.
POST /api/auth/register
: Register a new user.POST /api/auth/login
: Log in an existing user.
POST /api/json/flatten
: Flatten a JSON object.POST /api/json/parse
: Parse a JSON string.
POST /api/markdown/render
: Render Markdown to HTML.
POST /api/color/convert
: Convert color between HEX and RGB formats.
POST /api/regex/validate
: Validate input against a regular expression.
For detailed request and response formats, refer to each route's respective documentation in the codebase or use tools like Swagger for API documentation.
The API handles errors gracefully and returns appropriate HTTP status codes along with error messages in JSON format. Middleware functions are used for centralized error handling to ensure consistency.
Contributions are welcome! If you have any suggestions, improvements, or feature requests, feel free to open an issue or create a pull request.