Overview

Discover moclojer - a simple HTTP mock server for development and testing. Create realistic API mocks from YAML, OpenAPI, or Postman Collections with dynamic responses and WebSocket support.

moclojer is a simple and efficient HTTP mock server that helps you simulate APIs for development, testing, and prototyping. Instead of depending on real APIs that might be slow, unreliable, or not yet built, moclojer lets you create fake APIs that respond exactly how you need them to.

Why use moclojer?

🚀 Faster Development

Start building your frontend or application immediately, even when the backend APIs aren't ready yet. No more waiting for other teams or services.

🧪 Better Testing

Create predictable test scenarios by controlling exactly what your API returns. Test error cases, edge conditions, and different response formats easily.

🔧 Simple Configuration

Define your mock APIs using simple YAML files. No complex setup, no programming required for basic mocks.

📱 Realistic Simulations

Support for dynamic responses, path parameters, query parameters, WebSockets, webhooks, and more advanced features.

How does it work?

moclojer reads configuration files (YAML, EDN, OpenAPI, or Postman Collections) that describe your API endpoints and their responses. When a request comes in, it matches the request to your configuration and returns the appropriate response.

Simple example:

When someone makes a GET request to /users/123, moclojer responds with:

Notice how {{path-params.id}} automatically gets replaced with the actual ID from the URL.

What can you do with moclojer?

  • REST API Mocking - Complete CRUD operations with dynamic responses

  • GraphQL Mocking - Mock GraphQL endpoints and resolvers

  • WebSocket Support - Real-time bidirectional communication

  • Webhook Simulation - Trigger background requests after handling requests

  • Rate Limiting - Simulate API limits and throttling

  • Multi-Domain Support - Handle multiple domains in one configuration

  • External Data - Load responses from files or remote URLs

  • Integration Testing - Use as a library in your Clojure applications

Common use cases

Frontend Development

Mock your backend APIs so frontend developers can work independently:

API Testing

Create specific test scenarios including error conditions:

Microservices Development

Mock dependencies between services:

Third-Party API Simulation

Mock external APIs for development and testing:

Who uses moclojer?

  • Frontend Developers - Building UIs without waiting for backend APIs

  • Backend Developers - Testing API integrations and microservices

  • QA Engineers - Creating consistent test environments

  • DevOps Teams - Setting up development and staging environments

  • Product Teams - Prototyping and demonstrating features

Getting started

Ready to create your first mock API? Here's what you'll learn:

  1. Installation - Get moclojer running on your system

  2. Using Postman Collections - Already have Postman Collections? Start here!

  3. Your First Mock Server - Create and test a simple API with YAML

  4. Dynamic Responses - Make your mocks respond to different inputs

  5. Multiple Endpoints - Build a complete API with multiple routes

  6. Real-World Example - Put it all together with a practical example

Each tutorial builds on the previous one, so you'll have a solid understanding of moclojer by the end.

Need help?

Explore more

Once you're comfortable with the basics, dive deeper into moclojer's features:

Configuration Formats

Parameters

Practical Guides

Let's get started! 🚀

Last updated

Was this helpful?