1.0.3 • Published 4 years ago
umi-plugin-localtunnel v1.0.3
umi-plugin-localtunnel
A plugin for exposing local umi 3 web application to the world for sharing and testing.
Usage
Install
- Install plugin
$ npm install umi-plugin-localtunnel- umi would automatically detect the plugin and register it(No need to explicitly declare inside plugin, or duplicated register error would be throwed)
Configuration
Use key (localtunnel) to configure the plugin inside .umirc.js file:
import { defineConfig } from 'umi';
export default defineConfig({
localtunnel: {
host: 'https://localtunnel.me',
subdomain: 'my-umi-application',
},
});| Key | Default | Description |
|---|---|---|
| host | https://localtunnel.me | URL for the upstream proxy server. |
| subdomain | umi-project idendity | Request a specific subdomain on the proxy server. |
NOTE: Umi-plugin-localtunnel use localtunnel module inside. For more information, refer to its official document.
Disable plugin
To disable plugin, just remove localtunnel configuration in .umirc.js.
Runtime
After first development compile, the localtunnel would be connected. And the following information would be printed to the terminal: Tunnel is running on: https://[subdomain].[host]. Just click the link to use it.
Plugin Development
Install
# or yarn
$ npm install$ npm run build --watch
$ npm run startUsage
Configure in .umirc.js,
export default {
plugins: ['path/to/your/local/umi-plugin-localtunnel'],
localtunnel: {
...
}
};For more informatiom, refer to plugin and plugin API of umi document.