Mock API for REST!!!!

Overview

Mock API Server

Introduction

This app allows you to add urls and serve dummy json responses. It contains two handlers, the DummyHandler allows you to map a route to a json schema which will be served as the response and DummyErrorHandler allows you to add an endpoint that will return a specific error which is useful for mocking error states.

Running The Server Locally

Complete the following steps to run this app:

  • Ensure golang is installed on your machine
  • Build the app using go build -o bin/mock-api-server
  • Run the app using ./bin/mock-api-server

The dummy api will now be available on localhost:8080

Adding Routes

Routes can be added to the router.go file. Example routes have been added which you can copy. You need only change the url and path to the schema and optionally specify a response http status code. If no status is passed the endpoint will return a status of 200:

mux.Handle(
    "/api/test-url",
    &h.DummyHandler{
        FilePath: "./schemas/your_json_response.json",
        Status: 201,
    },
)

Rapid Heroku Deployment

It's possible to have a live dummy server up and running within minutes with heroku by doing the following (it's free!)

  • Clone this repo and then remove the .git folder rm -rf .git
  • Create an Heroku account if you don't already have one
  • Install the Heroku CLI
  • Sign into you heroku account and create a new app
  • On the deploy tab select "Heroku Git" and follow the commands given.
Mock-the-fck - Mock exercise for human

Mock the fck Originally, Mockery-example Example case for mockery issue #128 fil

Mike Cat 0 Jan 21, 2022
Mock API for REST!!!!

Mock API Server Introduction This app allows you to add urls and serve dummy json responses. It contains two handlers, the DummyHandler allows you to

null 2 Jun 20, 2022
Simple mock program to set charging rate of a battery instance based on the national grid intensity api

Charger Simple mock program to set charging rate of a battery instance based on the national grid intensity api. Steps to get up and running I have cr

Taj 0 Nov 16, 2021
mock server to aid testing the jaguar-java client API

stripe-mock stripe-mock is a mock HTTP server that responds like the real Stripe API. It can be used instead of Stripe's test mode to make test suites

knr.data 1 Dec 24, 2021
Sql mock driver for golang to test database interactions

Sql driver mock for Golang sqlmock is a mock library implementing sql/driver. Which has one and only purpose - to simulate any sql driver behavior in

DATA-DOG 4.5k Jun 25, 2022
HTTP mock for Golang: record and replay HTTP/HTTPS interactions for offline testing

govcr A Word Of Warning I'm in the process of partly rewriting govcr to offer better support for cassette mutations. This is necessary because when I

Seb C 105 May 18, 2022
Powerful mock generation tool for Go programming language

Summary Minimock generates mocks out of Go interface declarations. The main features of minimock are: It generates statically typed mocks and helpers.

Juno Inc. 455 Jun 15, 2022
Mock object for Go http.ResponseWriter

mockhttp -- Go package for unit testing HTTP serving Unit testing HTTP services written in Go means you need to call their ServeHTTP receiver. For thi

Tv 21 Mar 22, 2022
ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format

ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format. This service can then simply be consumed by any client to get the expected response.

Sumit Tokkar 3 Mar 2, 2021
mockery - A mock code autogenerator for Golang

mockery - A mock code autogenerator for Golang

Vektra 3.6k Jun 26, 2022
Create your own mock server with just a JSON file!

Gmocker Run a blazing fast mock server in just seconds! ?? All you need is to make a json file that contains path and response mapping. See an example

Ananto 49 Apr 13, 2022
Create your own blazing fast mock server with just a JSON file!

Gmocker Run a blazing fast mock server in just seconds! ?? All you need is to make a json file that contains path and response mapping. See an example

Ananto 49 Apr 13, 2022
Vitaly Berg 7 Aug 10, 2021
Completely type-safe compile-time mock generator for Go

Mockc Mockc is a completely type-safe compile-time mock generator for Go. You can use it just by writing the mock generators with mockc.Implement() or

Geon Kim 29 May 23, 2021
Merge Mock - testing tool for the Ethereum Merge

MergeMock Experimental debug tooling, mocking the execution engine and consensus node for testing. work in progress Quick Start To get started, build

Diederik Loerakker 33 Jun 17, 2022
A basic lightweight HTTP client for Go with included mock features.

A basic lightweight HTTP client for Go with included mock features. Features Support almost all http method like G

Andres Mijares 1 May 2, 2022
📡 mock is a simple, cross-platform, cli app to simulate HTTP-based APIs.

mock ?? mock is a simple, cross-platform, cli app to simulate HTTP-based APIs. About mock Mock allows you to spin up a local http server based of a .m

Bruno Schaatsbergen 8 May 6, 2022
A mock of Go's net package for unit/integration testing

netmock: Simulate Go network connections netmock is a Go package for simulating net connections, including delays and disconnects. This is work in pro

Lucas Wolf 1 Oct 27, 2021
Just Dance Unlimited mock-up server written on Golang and uses a popular Gin framework for Go.

BDCS Just Dance Unlimited mock-up server written on Golang and uses a popular Gin framework for Go. Features Security Authorization works using UbiSer

Mikhail 0 Nov 10, 2021