JKHeadley / rest-hapi

🚀 A RESTful API generator for Node.js
https://resthapi.com
MIT License
1.19k stars 152 forks source link

Feature/hapi server config #172

Closed shiva closed 5 years ago

shiva commented 5 years ago
  1. Minor commit to include code-cov as part of dev dependency
  2. Support for baseUrl in REST-HAPI
  3. pass through hapi-swagger configuration as an option.
  4. Support all legacy options, but those get overridden when config.swaggerOptions is set (as per hapi-swagger documentation).
  5. Additionally some swaggerOptions are over-written.
shiva commented 5 years ago

Note: The build actually passed, but there seems to be a stage that pushes to this repo, and that step failed.

JKHeadley commented 5 years ago

@shiva Awesome, thanks! I'll try to check it out soon.

codecov[bot] commented 5 years ago

Codecov Report

Merging #172 into master will decrease coverage by <.01%. The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
- Coverage   94.48%   94.48%   -0.01%     
==========================================
  Files          43       43              
  Lines       11342    11350       +8     
==========================================
+ Hits        10717    10724       +7     
- Misses        625      626       +1
Impacted Files Coverage Δ
utilities/rest-helper-factory.js 79.87% <ø> (ø) :arrow_up:
config.js 100% <100%> (ø) :arrow_up:
rest-hapi.js 80.89% <85.71%> (+0.41%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b069959...6991743. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #172 into master will decrease coverage by <.01%. The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
- Coverage   94.48%   94.48%   -0.01%     
==========================================
  Files          43       43              
  Lines       11342    11350       +8     
==========================================
+ Hits        10717    10724       +7     
- Misses        625      626       +1
Impacted Files Coverage Δ
utilities/rest-helper-factory.js 79.87% <ø> (ø) :arrow_up:
config.js 100% <100%> (ø) :arrow_up:
rest-hapi.js 80.89% <85.71%> (+0.41%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b069959...44a15db. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #172 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   94.48%   94.49%   +<.01%     
==========================================
  Files          43       43              
  Lines       11342    11350       +8     
==========================================
+ Hits        10717    10725       +8     
  Misses        625      625
Impacted Files Coverage Δ
config.js 100% <100%> (ø) :arrow_up:
rest-hapi.js 82.02% <100%> (+1.53%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6aecd29...5985e09. Read the comment docs.

JKHeadley commented 5 years ago

@shiva made some slight modifications. Apologies, it looks like I misinformed you. To set a prefix for all rest-hapi routes the correct way would be to use the correct hapi register option . For example, when you register rest-hapi you could do this like so:

    await server.register({
      plugin: RestHapi,
      options: {
        mongoose: mongoose,
        config: config,
      },
      routes: {
        prefix: '/test'
      }
    })

I'll spend a little more time reviewing these changes and then try to merge them. Let me know if you have any thoughts.

shiva commented 5 years ago

This make more sense. Would you like me to squash these changes, and reduce the amount of churn before you merge?

JKHeadley commented 5 years ago

@shiva Yes a squash would be great. First though I would like to make sure the docs get updated to reflect the changes. Feel free to update them if you like, or I will try to get to it soon. Thanks!

shiva commented 5 years ago

@JKHeadley Here is the newly cleaned up commits. I will make another commit for updating the docs and get back

shiva commented 5 years ago

Updated documentation as well. @JKHeadley Let me know if you need anything else before merge

JKHeadley commented 5 years ago

Awesome, thanks!