Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Jan 12, 2018
2 parents 3a70dec + 5bc704e commit 2d935d5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# MockJSONAPI Server
MockJSONAPI is a mock server for a generic JSON API built with Delphi and delphimvcframework. Can be used with any client technology and language.

When mockjsonapi server receives a requests it matches the request against the `data.json` that have been configured.
MockJSONAPI is a mock server for a generic JSON API built with Delphi and delphimvcframework. Can be used with any client technology and language. When mockjsonapi server receives a requests it matches the request against the `data.json` that have been configured.
If you are an experienced user, grab the latest [binary release here](https://github.com/danieleteti/mockjsonapi/releases) otherwise, keep reading the docs.

## Getting started
Let's say that you need to develop a REST client (e.g. mobile app, web client, web SPA or a desktop thin client) and you need some endpoints to use. The usual problem in this case is that you need to start to develop the server before you can show something to the end user. MockJSONAPI server soves this problem giving to the developer a bare-bone REST server with the standard CRUD interface. The data are stored into a single JSON file.
Expand Down Expand Up @@ -31,12 +30,12 @@ The configuration of the server are really trivial. The `data.json` file contain
MockJSONAPI server supports *all* the resources that you need. So you can ask to the API any resourceusing an HTTP `GET`. If that resource exists in the `data.json` file, then will be returned to the client, otherwise an empty array will be returned.

If you try to create a new entity under a specific resource, then that resource will be automaticaly created and stored in the file.
I strongly suggest to play with the server using curl or Postman. Just launch `mockjsonapi.exe` and follow the curl session below.

Here's a typical curl session over the server.

Here's a typical curl session which uses the `mockjsonapi` server.


>Let's ask for a non exists resource
Let's ask for a non existent resource.
```
Daniele@DANIELETETI C:\Users\Daniele
$ curl -i -XGET http://localhost:8080/api/customers
Expand Down Expand Up @@ -160,4 +159,3 @@ DELETE /api/resourcename

## How to use it
Using MockJSONAPI Server is really siple. Just run the executable with the `data.json` file in the exe folder. You are productive in seconds starting to use the Mock API. If you want to "load" data in the server storage, just change the `data.json` with your own data.

0 comments on commit 2d935d5

Please sign in to comment.