You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@
4
4
5
5
Example Hapi-backed API Server with testing, CI, and Swagger documentation generator.
6
6
7
-
Updated and tested with latest hapi packages as of 8/4/2016.
7
+
Updated and tested with latest hapi packages as of 1/16/2018.
8
8
9
9
## How to run
10
-
Requires Node v5.2.0+
10
+
Requires Node v8.9.0+
11
11
```sh
12
-
npm install #install dependencies
13
-
npm start # start server
14
-
npmtest# run tests
12
+
yarn install #install dependencies
13
+
yarn start # start server
14
+
yarntest# run tests
15
15
```
16
16
17
17
## Details
@@ -35,15 +35,13 @@ Requires Node v5.2.0+
35
35
- Code Coverage
36
36
-`lab` analyzes the code and returns the code coverage ratio when running the test. It also points out which lines of code are missing coverage. A nice reminder to write tests for any newly added functionality.
37
37
- Documentation
38
-
-`hapi-swagger` is configured in `app.js` and generates a very nice html page with an interactive Swagger compatible API.
38
+
-`hapi-swagger` is configured in `app.js` and generates a very nice html page with an interactive Swagger compatible API.
39
39
- Once your server is running locally, visit [http://localhost:3000](http://localhost:3000) to check out the docs.
40
-
- My typical workflow is to write the documentation first (by setting up the hapi routing #2BirdsWith1Stone), then to write the functional tests, then a combination of code and unit tests ala [TDD](http://www.jamesshore.com/Blog/Red-Green-Refactor.html) until I'm satisfied with the results.
40
+
- My typical workflow is to write the documentation first (by setting up the hapi routing #2BirdsWith1Stone), then to write the functional tests, then a combination of code and unit tests ala [TDD](http://www.jamesshore.com/Blog/Red-Green-Refactor.html) until I'm satisfied with the results.
41
41
42
42
- CI
43
43
- This repo also integrates [TravisCI](https://travis-ci.org/), which runs the tests defined above on every pull request, blocking a merge if the test does not pass. Not very useful for a one person project, but crucial when a team of developers is involved.
44
44
45
45
## TODO
46
46
* add stubbing framework to imitate external service calls.
47
47
* Figure out an easy way to test multiple hapi services together, in a microservice environment.
48
-
* Integrate `boom` for API error responses.
49
-
* Add example for testing hapi route validation (6/17/2017)
0 commit comments