Create A New Route

Add A New Route

When you have a mockspace, you can start adding routes to it. In a mockspace, all routes share the same base-url.

Creating A Route

Creating route is the second most simplest task in the application (atleast for a basic route). Routes can be created by going to the mockspace dashboard and clicking on add route just below the table. If the route limit reached its maximum limit of the mockspace a route wont be created. You can also go to add route page by clicking on the add route button in the side drawer. Once you are on the add route page, if this is the first time you are creating a route in the mockspace, simply clicking add Route will create a very basic route. There are various values you can change to personalize the route. These settings and values are discussed below.

Choosing Route URL

Mockback allows you to have custom url. The base url remains https://api.mockback.ml/ (opens in a new tab) followed by the mockspace URL, after that you do have the freedom to choose the url you want. It could even be just a / . The routes in a mockspace has to be unique, that means you could only have 1 route as /, if you try to make another one, it wont allow it.

More customization are in developement and will be revealed soon.

Choosing Route HTTP Status

You can choose the status code which will be responded with on calling the api. The are alot (seriously alot) of status codes you can choose from.

Choosing Route Charset

You can choose the charset for the response when you create a route.

Choosing Route Method

Mockback allows you choose which method the end point responds to. By default it is set to ALL, but you can choose others such as GET, POST etc.

Authorization

You could choose to add authorization to your routes. If enabled, the request is needed to contain the allowed id( discussed in next para), as authrorization header. You can add ids which will be authorized to the request from the addroute page itself.

Do NOT include bearer token in the header.

Custom Header

You could add custom headers which will be send with the response on calling the route. You can choose the key and its value.

Types Of Responses

Empty Body

Empty body response type is pretty self explanatory. The response body will be empty and will not contain any data.

Custom Response

You could provide the json data which will be sent when calling the route.

Server Generated Response

This is the best feature of mockspace. You could choose the data type it should respond with and on calling the route, a random data will be generated. You can choose from 50+ data types and define the structure of the response. You could choose the length of the response array. If grater that 1, it will generate multiple response and send it as an array.