All Projects → urbanairship → Frock

urbanairship / Frock

Licence: other
A plugin-based tool for running fake HTTP and socket services

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Frock

Gitless
A simple version control system built on top of Git
Stars: ✭ 1,660 (+1085.71%)
Mutual labels:  developer-tools
Works For Me
Collection of developer toolkits
Stars: ✭ 131 (-6.43%)
Mutual labels:  developer-tools
Duckrails
Development tool to mock API endpoints quickly and easily (docker image available)
Stars: ✭ 1,690 (+1107.14%)
Mutual labels:  developer-tools
Cakebox
Framework agnostic virtual PHP Development Environment
Stars: ✭ 127 (-9.29%)
Mutual labels:  developer-tools
D Tools
d-tools is a toolbox for developers.Formatter, Base64, Regex test,Host manager and so on.
Stars: ✭ 131 (-6.43%)
Mutual labels:  developer-tools
Phoenix Docker Compose
Docker development environment for Elixir+Phoenix
Stars: ✭ 131 (-6.43%)
Mutual labels:  developer-tools
Service Worker Detector
This extension detects if a website registers a Service Worker.
Stars: ✭ 124 (-11.43%)
Mutual labels:  developer-tools
Anonydog
On the internet, nobody knows you're a dog
Stars: ✭ 138 (-1.43%)
Mutual labels:  developer-tools
Express Routemap
Display all your express routes in the terminal!
Stars: ✭ 131 (-6.43%)
Mutual labels:  developer-tools
Poethepoet
A task runner that works well with poetry.
Stars: ✭ 137 (-2.14%)
Mutual labels:  developer-tools
Check It Out
A command line interface for Git Checkout. See branches available for checkout.
Stars: ✭ 127 (-9.29%)
Mutual labels:  developer-tools
Poodle
🔥 A fast and beautiful command line tool to build API requests.
Stars: ✭ 129 (-7.86%)
Mutual labels:  developer-tools
Boop
A scriptable scratchpad for developers. In slow yet steady progress.
Stars: ✭ 2,425 (+1632.14%)
Mutual labels:  developer-tools
Grmon
Command line monitoring for goroutines
Stars: ✭ 1,703 (+1116.43%)
Mutual labels:  developer-tools
Sailboat
🐍 A quick and easy way to distribute your Python projects!
Stars: ✭ 137 (-2.14%)
Mutual labels:  developer-tools
Taking Advantage Of Google Apps Script
Here, CLI tools, libraries, Add-ons, Reports, Benchmarks and Sample Scripts for taking advantage of Google Apps Script which are publishing in my blog, Gists and GitHub are summarized.
Stars: ✭ 123 (-12.14%)
Mutual labels:  developer-tools
Instapack
All-in-one TypeScript and Sass compiler for web applications! 📦 🚀
Stars: ✭ 131 (-6.43%)
Mutual labels:  developer-tools
Zunit
A powerful testing framework for ZSH projects
Stars: ✭ 140 (+0%)
Mutual labels:  developer-tools
Tenderly Cli
CLI tool for Smart Contract error tracking, monitoring and alerting.
Stars: ✭ 138 (-1.43%)
Mutual labels:  developer-tools
Responsively App
A modified web browser that helps in responsive web development. A web developer's must have dev-tool.
Stars: ✭ 14,425 (+10203.57%)
Mutual labels:  developer-tools

frock

A plugin-based tool for running fake HTTP and socket services.

Build Status npm install js-standard-style

frock is a tool for running fake services and serving mock data. It's designed for developers who work in service-oriented architectures, and need to stand up fake services that approximate production services in their development environments.

frock itself is a host for running HTTP and socket services, and its HTTP router makes it simple to run multiple services on the same port. Outside of the core functions of starting services and routing to handlers, frock's functionality is implemented through plugins and middleware that you write.

There are some generic plugins provided for out-of-the-box functionality:

  • frock-static is a plugin for serving static content from files, directories, or URLs.
  • frock-proxy is a plugin for proxying requests from frock to a remote server.

For a quick overview of the functionality frock provides, see the example in this README.

Quick-Start Example

frock is a Node.js CLI utility, which loads a frockfile from your project directory. In the following example, we'll create a service that proxies requests to your local development server at http://localhost:8052, but intercepts some URLs to serve static content from a variety of sources.

In your working directory, create a frockfile.json:

{
  "servers": [
    {
      "port": 8080,
      "routes": [
        {
          "path": "/api/segments",
          "methods": ["GET"],
          "handler": "frock-static",
          "options": {
            "file": "fixtures/static/segments.json",
            "contentType": "application/json"
          }
        },
        {
          "path": "/api/remote",
          "methods": ["GET"],
          "handler": "frock-static",
          "options": {
            "url": "http://raw.githubusercontent.com/somewhere/something.json",
            "contentType": "application/json"
          }
        },
        {
          "path": "*",
          "methods": "any",
          "handler": "frock-proxy",
          "options": {
            "url": "http://localhost:8052"
          }
        }
      ]
    }
  ]
}

Install frock and the plugins you requested:

$ npm install frock frock-static frock-proxy

Then, run frock:

$ frock

This examples expects that your PATH is set to run Node.js packages from your project's installed node_modules; see the Understanding Packages section of the documentation for details.

Note: By default, frock only allows connections from localhost; see the docs on connection filtering for details.

Detailed Documentation

frock's documentation is split into several sections:

  • Using frock in your project/Understanding Packages is an overview of how frock is meant to sit alongside your project.
  • Implementing mocks/fakes:
    • Plugins: writing plugins, where you'll implement your fake services.
    • Middleware: writing middleware, which can augment your plugins' functionality.
    • Cores: writing cores, which can extend the core functionality of frock.
  • frockfile Reference, which explains the configuration file format that frock uses, the frockfile.json
  • Examples which provides detailed examples of using frock, and can help you understand how to implement your fake services.
  • API details the frock API, which can be used programatically rather than via the provided CLI. This also documents the frock singleton your plugins will be passed when they are instantiated.

CLI

The frock command will search upward from your current directory for a frockfile.json, and run it.

Use the built-in help to learn about other options:

$ frock --help

Some options can be set via environment variables; these provide defaults, which can still be overridden by explicitly passing CLI flags. Set these to any value besides an empty string to set the default to true:

  • FROCK_DEBUG set the log level to debug
  • FROCK_RAW_OUTPUT output the raw log JSON rather than pretty-printing
  • FROCK_UNSAFE_DISABLE_CONNECTION_FILTERING disable processing of whitelists/blacklists for connections, and allow any incoming connections

Testing

From the project directory:

$ npm test

Any test file that should be run must be required in the tests/index.js file.

License

Apache 2.0, see LICENSE for details.

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].