-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started with mockingbird
ozkeisar edited this page Jun 3, 2024
·
2 revisions
Mockingbird stands out as a robust tool for developers looking to simulate server environments and streamline the front-end development process. In this article, we'll walk through the process of setting up a project in Mockingbird, creating a new server, adding routes, and defining responses.
When you launch Mockingbird, you'll find yourself on the dashboard. Here's where the magic begins:
-
Create a New Server:
- Click on the
+ new server
button on the left-hand navigation panel. - A dialogue box will appear where you can input the server's name and the port number it should listen on.
- Input your desired server name and a port number that's open on your machine.
- Click
SAVE
to establish your new server.
- Click on the
-
Add a New Parent or Route:
- To add a new category or parent directory for your endpoints, right-click on the server or an existing parent and select
New Parent
. - In the modal that appears, fill in the path and filename.
- Click
SAVE
to add the new parent to your server structure.
- To add a new category or parent directory for your endpoints, right-click on the server or an existing parent and select
-
Creating Routes:
- Right-click on a parent and select
Add Route
. - Specify the HTTP method and route path, and add a description if needed.
- If your route requires parameters, specify where they are located (body, query, etc.), their keys, and values.
- Click
ADD ROUTE
to finalize the route creation.
- Right-click on a parent and select
-
Set Up Responses:
- Select a route from the sidebar to see the response configuration options.
- Click on
EDIT
to define the response. - Choose the type of response: Function, Object, or Proxy.
- Enter the response details. If it's an object, input the JSON directly. For a function, write the necessary JavaScript code.
- Click
SAVE
after setting up your response logic.
With your server, routes, and responses configured, you're ready to start the server and begin testing:
- Click the
Start Server
button at the top right corner of your dashboard to make the server live. - Test the endpoints from your frontend application or API client.
- Iterate over your responses as needed to simulate various scenarios.
Happy mocking!
For support or inquiries, contact us at [email protected]