All Projects → chanioxaris → json-server

chanioxaris / json-server

Licence: MIT license
Create a dummy REST API from a json file with zero coding in seconds

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to json-server

mokker
The mock does not mock you. The video: https://www.youtube.com/watch?v=gGLNJpC-Ov0
Stars: ✭ 13 (-61.76%)
Mutual labels:  json-api, mock-server, json-server
Jsonapi Rails
Rails gem for fast jsonapi-compliant APIs.
Stars: ✭ 242 (+611.76%)
Mutual labels:  json-api, jsonapi
Jsonapi Rb
Efficiently produce and consume JSON API documents.
Stars: ✭ 219 (+544.12%)
Mutual labels:  json-api, jsonapi
Devspace
DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
Stars: ✭ 2,559 (+7426.47%)
Mutual labels:  development, development-tools
Coloquent
Javascript/Typescript library mapping objects and their interrelations to JSON API, with a clean, fluent ActiveRecord-like (e.g. similar to Laravel's Eloquent) syntax for creating, retrieving, updating and deleting model objects.
Stars: ✭ 149 (+338.24%)
Mutual labels:  json-api, jsonapi
Json Api
Implementation of JSON API in PHP 7
Stars: ✭ 171 (+402.94%)
Mutual labels:  json-api, jsonapi
Papercut Smtp
Papercut SMTP -- The Simple Desktop Email Server
Stars: ✭ 2,094 (+6058.82%)
Mutual labels:  development, development-tools
Symfony Jsonapi
JSON API Transformer Bundle for Symfony 2 and Symfony 3
Stars: ✭ 114 (+235.29%)
Mutual labels:  json-api, jsonapi
php-serializer
Serialize PHP variables, including objects, in any format. Support to unserialize it too.
Stars: ✭ 47 (+38.24%)
Mutual labels:  json-api, jsonapi
jsonapi-serializable
Conveniently build and efficiently render JSON API resources.
Stars: ✭ 43 (+26.47%)
Mutual labels:  json-api, jsonapi
fire
An idiomatic micro-framework for building Ember.js compatible APIs with Go.
Stars: ✭ 56 (+64.71%)
Mutual labels:  json-api, jsonapi
Weld
Full fake REST API generator written with Rust
Stars: ✭ 146 (+329.41%)
Mutual labels:  json-api, mock-server
Jsona
Data formatter that creates simplified objects from JSON or stored reduxObject, creates JSON from the same simplified objects (in according with JSON API specification)
Stars: ✭ 144 (+323.53%)
Mutual labels:  json-api, jsonapi
Jsonapi Utils
Build JSON API-compliant APIs on Rails with no (or less) learning curve.
Stars: ✭ 191 (+461.76%)
Mutual labels:  json-api, jsonapi
Jsonapi.rb
Lightweight, simple and maintained JSON:API support for your next Ruby HTTP API.
Stars: ✭ 116 (+241.18%)
Mutual labels:  json-api, jsonapi
Monday
⚡️ A dev tool for microservice developers to run local applications and/or forward others from/to Kubernetes SSH or TCP
Stars: ✭ 1,246 (+3564.71%)
Mutual labels:  development, development-tools
DummyJSON
DummyJSON provides different types of REST Endpoints filled with JSON data which you can use in developing the frontend with your favorite framework and library without worrying about writing a backend.
Stars: ✭ 213 (+526.47%)
Mutual labels:  json-api, json-server
Jsonapi Client
JSON API (jsonapi.org) client for Python
Stars: ✭ 63 (+85.29%)
Mutual labels:  json-api, jsonapi
Loopback Component Jsonapi
JSONAPI support for loopback.
Stars: ✭ 104 (+205.88%)
Mutual labels:  json-api, jsonapi
Minishift
Run OpenShift 3.x locally
Stars: ✭ 2,246 (+6505.88%)
Mutual labels:  development, development-tools

JSON Server

License: MIT GoDoc Release

codecov goreportcard

Create a dummy REST API from a json file with zero coding in seconds. Helps you to continue your development process when an API you depend on, doesn't exist or isn't complete yet.

Inspired from json-server javascript package.

Executables

Cross-platform (Windows, Linux, macOS) binaries are available for download. Select the executable that match your Operating System and run json-server without any dependencies, with minimum effort.

Getting started

Get the package

go get github.com/chanioxaris/json-server

Create a db.json file with your desired data

{
  "posts": [
    { 
       "id": "1", 
       "title": "json-server", 
       "author": "chanioxaris" 
    }
  ],
   "books": [
     {
       "id": "1",
       "title": "Clean Code",
       "published": 2008,
       "author": "Robert Martin"
     },
     {
       "id": "2",
       "title": "Crime and punishment",
       "published": 1866,
       "author": "Fyodor Dostoevsky"
     }
   ]
}

Start JSON Server

go run main.go start

If you navigate to http://localhost:3000/posts/1, you will get

{ 
  "id": "1", 
  "title": "json-server", 
  "author": "chanioxaris" 
}

Routes

Based on the previous json file and for each resource, the below routes will be generated

GET     /<resource>
GET     /<resource>/:id
POST    /<resource>
PUT     /<resource>/:id
PATCH   /<resource>/:id
DELETE  /<resource>/:id

When doing requests, it's good to know that:

  • For POST requests any id value in the body will be honored, but only if not already taken.
  • For POST requests without id value in the body, a new one will be generated.
  • For PUT requests any id value in the body will be ignored, as id values are not mutable.
  • For PATCH requests any id value in the body will be ignored, as id values are not mutable.

Parameters

  • You can specify an alternative port with the flag -p or --port. Default value is 3000.

go run main.go start -p 4000

  • You can specify an alternative file with the flag -f or --file. Default value is db.json.

go run main.go start -f example.json

  • You can toggle http request logs with the flag -l or --logs. Default value is false.

go run main.go start -l

Known issues

  • For users running macOS Catalina and newer versions, apple will prevent binary from run as it hasn't been notarized and signed. To overcome this issue, you can add a security exception for json-server.

Contributing

Contributions to this project are welcomed. For more information see the contribution guidelines.

License

json-server is MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].