1 | apeman-app-contrib-servestatic
|
2 | ======
|
3 |
|
4 | [![Build Status][my_travis_badge_url]][my_travis_url]
|
5 | [![Code Climate][my_codeclimate_badge_url]][my_codeclimate_url]
|
6 | [![Code Coverage][my_coveralls_badge_url]][my_coveralls_url]
|
7 | [![npm version][my_npm_budge_url]][my_npm_url]
|
8 |
|
9 | apeman app contribution plugin to server static files.
|
10 |
|
11 |
|
12 | Installation
|
13 | -------
|
14 |
|
15 | Install module via [npm][npm_url]
|
16 |
|
17 | ```bash
|
18 | $ npm install apeman-app-contrib-servestatic --save
|
19 | ```
|
20 |
|
21 | Usage
|
22 | -------
|
23 |
|
24 | 1. Define an app at `$apps` property in your Apemanfile.
|
25 | 2. Set "apeman-app-contrib-servestatic" to `$invoke` property for a url endpoint.
|
26 |
|
27 | ```javascript
|
28 | /**
|
29 | * This is example Apemanfile to use "apeman-app-contrib-servestatic".
|
30 | * @see https://www.npmjs.com/package/serve-static
|
31 | */
|
32 |
|
33 | "use strict";
|
34 |
|
35 | module.exports = {
|
36 | $pkg: {/*...*/},
|
37 | $apps: {
|
38 | // Define your own task.
|
39 | "my-awesome-app": {
|
40 | "/api/somepoint": [
|
41 | {
|
42 | "$invoke": "apeman-app-contrib-servestatic",
|
43 | "$args": [
|
44 | "public",
|
45 | "public/html"
|
46 | ],
|
47 | "$options": {
|
48 | "extensions": ['html', 'htm']
|
49 | }
|
50 | }
|
51 | ]
|
52 | }
|
53 | }
|
54 | };
|
55 | ```
|
56 |
|
57 | Then, run the app via [apeman app command][apeman_app_doc_url].
|
58 |
|
59 | ```bash
|
60 | // This will start development server to for the defined app.
|
61 | $ apeman app --port 3050
|
62 | ```
|
63 |
|
64 | Options
|
65 | -------
|
66 |
|
67 | Values which can be passed to `$options` property.
|
68 |
|
69 | | Name | Description |
|
70 | | ---- | ---- | ----------- |
|
71 | | dotfiles | String | How to treat dotfiles. 'allow', 'deny', or 'ignore'. |
|
72 | | etag | String | Enable or disable etag generation. |
|
73 | | extensions | String | Set file extension fallbacks. |
|
74 |
|
75 |
|
76 | License
|
77 | -------
|
78 |
|
79 | This software is released under the [MIT License][my_license_url].
|
80 |
|
81 |
|
82 | Links
|
83 | -------
|
84 |
|
85 | + [apeman][apeman_url]
|
86 | + [serve-static](https://www.npmjs.com/package/serve-static)
|
87 |
|
88 |
|
89 | [npm_url]: https://www.npmjs.com/
|
90 | [apeman_url]: https://github.com/apeman-repo/apeman
|
91 | [apeman_app_doc_url]: https://github.com/apeman-repo/apeman#app
|
92 | [my_repo_url]: https://github.com/apeman-repo/apeman-app-contrib-servestatic
|
93 | [my_travis_url]: http://travis-ci.org/apeman-repo/apeman-app-contrib-servestatic
|
94 | [my_travis_badge_url]: http://img.shields.io/travis/apeman-repo/apeman-app-contrib-servestatic.svg?style=flat
|
95 | [my_license_url]: https://github.com/apeman-repo/apeman-app-contrib-servestatic/blob/master/LICENSE
|
96 | [my_codeclimate_url]: http://codeclimate.com/github/apeman-repo/apeman-app-contrib-servestatic
|
97 | [my_codeclimate_badge_url]: http://img.shields.io/codeclimate/github/apeman-repo/apeman-app-contrib-servestatic.svg?style=flat
|
98 | [my_coveralls_url]: https://coveralls.io/github/apeman-repo/apeman-app-contrib-servestatic
|
99 | [my_coveralls_badge_url]: http://img.shields.io/coveralls/apeman-repo/apeman-app-contrib-servestatic.svg?style=flat
|
100 | [my_npm_url]: http://www.npmjs.org/package/apeman-app-contrib-servestatic
|
101 | [my_npm_budge_url]: http://img.shields.io/npm/v/apeman-app-contrib-servestatic.svg?style=flat
|
102 | [coz_url]: http://okunishinishi.github.io/node-coz/apiguide
|
103 |
|
104 |
|