Docs / Getting started

Getting started

Mockport Docs: Create a Project and Your First API Route

Get started with Mockport: create a hosted project, add and configure an API route, save a JSON response, and copy its public URL.

Mockport Team · 5 min read

Before you start

Create an account and open the Routes workspace. You will need a selected workspace to create a project; routes are created inside the selected project.

01

Create a project

A project groups the routes for one frontend, feature, or test environment. Sign in, open Routes, then use the Project menu and choose Create new project. If you have not created a project yet, you can also start from the empty Routes view.

Enter a recognizable project name and a unique project slug. The slug becomes part of the hosted domain, and must use lowercase letters, numbers, or hyphens, starting and ending with a letter or number. Check the Hosted domain preview, then select Create project. Mockport selects the new project when it is ready.

Project setup
Project name: Customer Portal
Project slug: customer-portal
Hosted domain: shown in the project form
Practical note

Projects belong to the selected workspace. The number of projects you can create depends on that workspace’s plan and limits.

02

Add your first route

With the project selected, find the Routes panel and select the + button (labeled Add route on extra-small screens). Mockport creates and selects a route immediately. The first route starts with GET, /v1/route/path1, 200 OK, and an empty JSON object; later routes use the next available default path.

Use the route editor to choose an HTTP method, enter the path your frontend will request, select a response status, and write the JSON response body. For example, a profile endpoint could use GET /v1/users/:id and return a representative profile. A dynamic path segment matches a requested value, but the response body itself remains the static JSON you configure.

Route configuration
Method: GET
Path: /v1/users/:id
Status: 200 OK
Response body:
{
  "id": "usr_123",
  "name": "Alex Johnson",
  "active": true
}
Practical note

Keep the response body valid JSON. The route editor shows whether the JSON is valid before you save.

03

Save and call the route

Select Save Changes after editing the route. When the editor reports Saved, copy the Generated public URL from the route details. It combines your selected project’s hosted domain with the route path.

Use that URL from your app, preview, or test with the same HTTP method configured on the route. Replace a dynamic segment such as :id with a real value in the request URL. You can use Test Route in the editor to check the configured endpoint.

Route configuration
https://{your-project-domain}/v1/users/usr_123
Practical note

Mockport returns the route’s configured response for each matching request. Use separate routes and status codes when you need distinct success and error scenarios.

Ready to build with your own hosted endpoint?

Start a 14-day trial and create a shared project for your team.

Create account →

Keep learning