Installations
npm install hapi-routify
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.1.0
NPM Version
6.0.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
g-div
Download Statistics
Total Downloads
3,658
Last Day
1
Last Week
1
Last Month
6
Last Year
209
GitHub Statistics
72 Commits
1 Forks
1 Watching
11 Branches
2 Contributors
Bundle Size
258.00 B
Minified
200.00 B
Minified + Gzipped
Package Meta Information
Latest Version
2.1.0
Package Id
hapi-routify@2.1.0
Unpacked Size
11.76 kB
Size
3.46 kB
File Count
13
NPM Version
6.0.1
Node Version
10.1.0
Total Downloads
Cumulative downloads
Total Downloads
3,658
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
-53.8%
6
Compared to previous month
Last year
-22.3%
209
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
hapi-routify
Just some lines of code to let you declare hapi routes from a manifest.json
The plugin is actually only a server.route
hapi call, nothing more.
Install
npm install --save hapi-routify
Why ?
If you use hapi with glue or rejoice, you may want to declare the routes of your application from the manifest.json
:
1{ 2 "server": { 3 "port": 8000 4 }, 5 "register": { 6 "plugins": [ 7 "h2o2", 8 { 9 "plugin": "hapi-routify", 10 "options": { 11 "routes": [{ 12 "method": "GET", 13 "path": "/{path*}", 14 "handler": { 15 "proxy": { 16 "host": "localhost", 17 "port": 3000 18 } 19 } 20 }] 21 } 22 }, 23 "blipp" 24 ] 25 } 26} 27 28
This example uses h2o2 to proxy all your requests to http://localhost:1337.
If you use rejoice there are actually two ways to provide your own handler:
- wrap your
manifest
with the CommonJSmodule.exports
declaration, so you will be able to write a javascript function (seeexamples/manifest.js
) - write a plugin that uses the
server.handler
method provided by hapi (seeexamples/manifest-customHandler.json
andexamples/customHandler/index.js
)
Options
routes
: the array of routes objects you will otherwise pass toserver.route
.
Dependencies
Package | Version | Dev |
---|---|---|
blipp | ^3.0.0 | ✔ |
code | ^5.2.4 | ✔ |
h2o2 | ^8.0.0 | ✔ |
hapi | ^17.8.1 | ✔ |
lab | ^18.0.0 | ✔ |
node-readme | ^0.1.9 | ✔ |
rejoice | ^5.0.1 | ✔ |
Contribute
Contributions are welcome! Open an issue to report bugs or request features. To contribute with code:
- clone this repository
- install the dependencies with
npm install
- make your changes to the files in the
src/
folder - write tests using lab in the
test/
folder - run tests with
npm test
. try to keep test coverage about 100% - edit the
.README.md
file and build the project again (npm run compile
) - send a pull request against the master branch
Author
g-div
Inspired by garthk's hapi-restify.js gist.
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 4/16 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 18 are checked with a SAST tool
Reason
33 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-mg85-8mv5-ffjr
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3
- Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-7hx8-2rxv-66xv
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-2mvq-xp48-4c77
- Warn: Project is vulnerable to: GHSA-5854-jvxx-2cg9
- Warn: Project is vulnerable to: GHSA-g64q-3vg8-8f93
Score
1.6
/10
Last Scanned on 2025-01-06
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More