UI developer tutorials and guides

Tuesday, June 14, 2022

Ceate a mock API using Github and Mockend

It's wise to establish a backed setup first, so that UI developers can test the data. So UI team has to wait for the later to complete job. 

The activation for single repo work only once, switching between repo will not work, it may cause to expire the mockend plan.

Mocking data is a great in such situations is a must. How to create mock API with custom data? 

So how do we create our own mock data with out a server?

We can create a REST and Graphql API using mockend.com and Github repository. For free usage only one repository can be activated.



In the Repository we have to setup the mock JSON file. (.mockend.json)

"User": {
"title": { "string": {} }
}
}

The title will be automatically generated for us. For advance use case we can use custom values and lorem strings.

Then the API can be read using any API client such as POSTMAN or Insomnia. The Graphql is worked for me using the Apollo Studio 

REST API URL:  mockend.com/org/repo/post

Replace the org with organization / user-name and repo with repository name.

The Graphql API URL will be  

mockend.com/org/repo/graphql

 

 

 


0 comments:

Post a Comment