Giter Site home page Giter Site logo

dev-api-proxy's Introduction

dev-api-proxy

An API proxy for REST applications.

Purpose

The purpose of this module is to provide a method to proxy api calls to your remove server while hosting static files from a local directory. You could have a dev server hosting your api on localhost:8080 serving /users-api /banking-api etc, while your html, js, css are locally available from your project directory. This is especially handing if you have something that builds your resources as you edit them (gulp watch eg.).

Configuration

This modules uses a file called devproxy.json in the project directory for the config.

contextPath - The context path on the remote server (usefull if it's not running on root /)

port - Port the proxy should be listening on (default 8000)

home - Index page if root is hit (default html/index.html)

staticPath Path to the static files to host

proxies - List of API's to proxy

proxies[n].host - Host to proxy to.

proxies[n].port - Port to connect to on the remote host.

proxies[n].path - Path of the local URL to math, and proxy. This is the important bit that is used to determine if this proxy should be used.

Configuration Example

{
  "contextPath" : "/myApp",
  "port" : 8000,
  "home" : "html/index.html",
  "staticPath" : "target/gulp",
  "proxies" : [
    {
      "host" : "localhost",
      "port" : 8080,
      "path" : "/users-api"
  },
  {
	"host" : "localhost",
	"port" : 8080,
	"path" : "/banking-api"
  }
  ]
}

dev-api-proxy's People

Contributors

trojanc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.