GithubHelp home page GithubHelp logo

sinchang-codespaces / anywhere Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacksontian/anywhere

0.0 2.0 0.0 58 KB

Running static file server anywhere / 随启随用的静态文件服务器

License: Other

JavaScript 100.00%

anywhere's Introduction

Anywhere 随启随用的静态文件服务器

Known Vulnerabilities

Running static file server anywhere. 随时随地将你的当前目录变成一个静态文件服务器的根目录。

Installation

Install it as a command line tool via npm -g.

npm install anywhere -g

Execution

$ anywhere
// or with port
$ anywhere -p 8000
// or start it but silent(don't open browser)
$ anywhere -s
// or with hostname
$ anywhere -h localhost -p 8888
// or with folder
$ anywhere -d ~/git/anywhere
// or enable html5 history
$ anywhere -f /index.html

Help

$ anywhere --help
Usage:
  anywhere --help // print help information
  anywhere // 8000 as default port, current folder as root
  anywhere 8888 // 8888 as port
  anywhere -p 8989 // 8989 as port
  anywhere -s // don't open browser
  anywhere -h localhost // localhost as hostname
  anywhere -d /home // /home as root
  anywhere -f /index.html  // Enable html5 history,the index is /index.html
  anywhere --proxy http://localhost:7000/api // Support shorthand URL, webpack.config.js or customize config file

Proxy argvs

Shorthand URL

anywhere --proxy http://localhost:7000/api
                 \___________________/\___/
                              |         |
                           target    context

More about the shorthand configuration.

Webpack config

// webpack.config.js
module.exports = {
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:7000',
        changeOrigin: true
      }
    }
  }
}

Customize config

// proxy.config.js
module.exports = {
  '/api': {
    target: 'http://localhost:7000',
    changeOrigin: true
  }
}

More proxy http-proxy-middleware help.

Visit

http://localhost:8000

Automatically open default browser. 执行命令后,默认浏览器将为您自动打开主页。

License

The MIT license.

anywhere's People

Contributors

gimjin avatar hstarorg avatar jacksontian avatar qinshou avatar shenqihui avatar sinchang avatar weakish avatar

Watchers

 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.