GithubHelp home page GithubHelp logo

youxian-simple-server's Introduction

@youxian/simple-server

  • author: 幽闲

Usage 基本使用

  • Install
yarn add @youxian/simple-server -D
  • add command to package.json
{
  "scripts": {
    "start": "server"
  }
}

Advanced Usage: 进阶使用(With nodemon)

  • Install
yarn add nodemon -D
  • update command in package.json
{
  "scripts": {
    "start": "nodemon --exec 'serve'"
  }
}

Feature 功能说明

启动一个简易 http 服务器,单纯返回静态资源(主要返回 index.html

与 @youxian/cli 的原生程序版本配套使用

API 说明

  • bin

serve 指令,全局安装的时候可在任意目录下使用指令

# in npm
npm i -g @youxian/simple-server
# in yarn
yarn global add @youxian/simple-server
  • parameters
Usage: serve [options]

Options:
  -v, --version          output the version number
  -f, --filename <path>  custom config filename,
                         default to server.config.json
  -h, --help             display help for command

-f, --filename <path> 参数接受传入自定义的配置文件,默认为 server.config.json

  • 静态资源查找路径

默认情况下下列目录将作为静态资源查找顺序

/
/public

youxian-simple-server's People

Contributors

superfreeeee avatar

Watchers

 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.