2.0.0-beta • Published 2 years ago

mini-cup v2.0.0-beta

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

Cup

NPM downloads NPM version

Easy to serve web resources, and proxy requests. You can make use of the Cup to mock Nginx for your web application sometimes.

中文文档 | English

Installation

$ npm install -g mini-cup

Or

$ yarn add -g mini-cup

Usage

Run the server by the specified path

$ cup run <path> //The path is your indicated directory

Run the server by the specified path and port

$ cup run <path> -p <port>

Run by cup.config.js config mode

Run the server by the custom configuration. There you can to initialize a cup.config.js file in the current working directory.

$ cup init

And run the start command:

$ cup run -c

The example of cup.config.js

const base = './dist'
module.exports = {
    name: 'example',
    listen: 3000,
    root: base,
    location: {
        '/api/task/get': `${base}/get.json`,
        '/api/task/add': `${base}/add.json`
    },
    proxyTable: {
        '/join': {
            target: 'https://github.com',
            changeOrigin: true
        }
    }
}

Proxy

More usage of Proxy, please refer to http-proxy-middleware.

License

MIT

2.0.0-beta

2 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago