All Projects → wizcodes → Jhop

wizcodes / Jhop

Licence: mit
🏎Create fake REST API in one sec.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Jhop

Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-66.89%)
Mutual labels:  rest-api, json, fake
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+70.95%)
Mutual labels:  rest-api, json, fake
Dashboard Server
A JSON file RESTful API with authorization based on json-server
Stars: ✭ 48 (-67.57%)
Mutual labels:  rest-api, fake
Diver.js
Dives deep into the dom and dumps it in the object literal notation.
Stars: ✭ 57 (-61.49%)
Mutual labels:  rest-api, json
Http Prompt
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
Stars: ✭ 8,329 (+5527.7%)
Mutual labels:  rest-api, json
Rest Api Examples
Test and Prototype with Fake Online REST/OAuth 2 APIs Examples
Stars: ✭ 13 (-91.22%)
Mutual labels:  rest-api, json
Jaymock
Minimal fake JSON test data generator.
Stars: ✭ 28 (-81.08%)
Mutual labels:  json, fake
Json Api Dart
JSON:API client for Dart/Flutter
Stars: ✭ 53 (-64.19%)
Mutual labels:  rest-api, json
Python Training For Network Engineers
Python hands-on training for network engineers. How to automate Junos with Python
Stars: ✭ 92 (-37.84%)
Mutual labels:  rest-api, json
Swagger Express Ts
Generate and serve swagger.json
Stars: ✭ 102 (-31.08%)
Mutual labels:  rest-api, json
Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (-27.03%)
Mutual labels:  rest-api, json
Restclient
🦄 Simple HTTP and REST client for Unity based on Promises, also supports Callbacks! 🎮
Stars: ✭ 675 (+356.08%)
Mutual labels:  rest-api, json
Ulfius
Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
Stars: ✭ 666 (+350%)
Mutual labels:  rest-api, json
Snmpbot
Golang SNMP library + SNMP REST API
Stars: ✭ 44 (-70.27%)
Mutual labels:  rest-api, json
Rest Assured
Java DSL for easy testing of REST services
Stars: ✭ 5,646 (+3714.86%)
Mutual labels:  rest-api, json
Spyke
Interact with REST services in an ActiveRecord-like manner
Stars: ✭ 591 (+299.32%)
Mutual labels:  rest-api, json
Grafanajsondatasource
Grafana datasource to load JSON data over your arbitrary HTTP backend
Stars: ✭ 146 (-1.35%)
Mutual labels:  rest-api, json
Laravel Api Response Builder
Builds nice, normalized and easy to consume Laravel REST API JSON responses.
Stars: ✭ 433 (+192.57%)
Mutual labels:  rest-api, json
Networking
⚡️ Elegantly connect to a REST JSON Api. URLSession + Combine + Decodable + Generics = <3
Stars: ✭ 499 (+237.16%)
Mutual labels:  rest-api, json
Jokeapi
A REST API that serves uniformly and well formatted jokes in JSON, XML, YAML or plain text format that also offers a great variety of filtering methods
Stars: ✭ 71 (-52.03%)
Mutual labels:  rest-api, json

jhop codecov Build Status

🏎Create fake REST API in one sec.

Buy Me A Coffee

Install

~ $ go get github.com/cooldrip/jhop/cmd/jhop

CLI Example

Create a file recipes.json:

{
  "recipes": [
    { "id": 1, "prep_time": "1h", "difficulty": "hard" },
    { "id": 2, "prep_time": "15m", "difficulty": "easy" }
  ]
}

Passing the JSON file to jhop:

~ $ jhop recipes.json

Now you can go to localhost:6000/recipes and get the collection:

{
  "recipes": [
    { "id": 1, "prep_time": "1h", "difficulty": "hard" },
    { "id": 2, "prep_time": "15m", "difficulty": "easy" }
  ]
}

or you can just get a single recipe localhost:6000/recipes/1:

{ "id": 1, "prep_time": "1h", "difficulty": "hard" }

API example

  f, err := os.Open("recipes.json")
  if err != nil {
    log.Fatalf("file opening failed: %s", err)
  }
  h, err := jhop.NewHandler(f)
  if err != nil {
    log.Fatalf("handler initialization failed: %s", err)
  }

  s := httptest.NewServer(h)
  defer s.Close()

  resp, err := http.Get(fmt.Sprintf("%s/recipes/1", s.URL))
  if err != nil {
    log.Fatalf("request to test server failed: %s", err)
  }

  io.Copy(os.Stdout, resp.Body) // {"difficulty":"hard","id":1,"prep_time":"1h"}

CLI usage

NAME:
   jhop - Create fake REST API in one sec.

USAGE:
   jhop [global options] command [command options] [arguments...]

VERSION:
   0.0.0

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --port value   Set port (default: "6000")
   --host value   Set host (default: "localhost")
   --help, -h     show help
   --version, -v  print the version

TODO

  • [x] Single resource
  • [ ] Custom routes
  • [ ] Middleware
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].