1.0.3 • Published 8 years ago

node-static-example v1.0.3

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

node-static-example

A example about how to build a static file server by node. See https://blog.acrazing.me/post/how-build-static-server-by-node.html.

Install

# npm package
npm install -g node-static-example

# typings
# maybe need
typings install --save --global npm:.d.ts/node-static-example.d.ts

Usage

  • in terminal

    # show help
    static-server --help
  • in modules

    import ServeStatic, {server, express} from 'node-static-example'
    
    // server Usage
    server({
      root: process.cwd(),
    }).listen(3000)
    
    // with express
    app.use(express({
      root: process.cwd(),
    }))
    
    // manual
    const serve = new ServeStatic({
      root: process.cwd(),
    })
    serve.serve('/test', req, res)

License

MIT

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago