🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

github.com/zlx/api-mock-server

Package Overview
Dependencies
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/zlx/api-mock-server

Source
Go Modules
Version
v1.2.1
Version published
Created
Source

Mock API Server

A Full-Featured API Mock Server

Demo

Installation

Install Mongodb

Install MongoDB

Clone the Project

git clone git@github.com:zlx/API-mock-server.git

Install Dependancy

bundle install --path=vendor/bundle

Usage

Mongodb Config

Configurate mongodb in mongoid.yml like below:

development:
  sessions:
    default:
      database: api_mock_server
      hosts: 
        - localhost:27017

Start Server

rackup

Visit

http://localhost:9292/admin

Default username/password: admin/admin

HowTo

How to config admin username/password ?

Config admin_user and admin_password in config.rb

How to config Top Namespace ?

Top Namespace is used for specific api version.

for an example, if you config top_namespace = "/api/v1", then you must visit "/api/v1/me" to reach "/me" route which you created.

Top namespace is a global setting, so it will take an effect for every routes you created.

To config top_namespace in in config.rb

Test

Mock Data

ruby seed.rb

Test the service using a curl or your favourite tool

curl http://localhost:4000
{ "hello": "world" }

Postman

https://github.com/a85/POSTMan-Chrome-Extension

Deploy on Server

work with unicorn

Guide for setup unicorn for rack app

unicorn config example

FAQs

Package last updated on 07 Nov 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts