Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add documentation endpoint #187

Draft
wants to merge 2 commits into
base: stable
Choose a base branch
from
Draft

Conversation

linuxbandit
Copy link
Member

this endpoint is to be queried by our swagger instance

NB: the docs themselves are NOT complete

this endpoint is to be queried by our swagger instance
@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #187 (af8e6f9) into master (a456462) will decrease coverage by 0.29%.
The diff coverage is 78.94%.

Impacted file tree graph

@@             Coverage Diff             @@
##            master     #187      +/-   ##
===========================================
- Coverage   100.00%   99.70%   -0.30%     
===========================================
  Files           42       44       +2     
  Lines         1321     1340      +19     
  Branches       202      204       +2     
===========================================
+ Hits          1321     1336      +15     
- Misses           0        4       +4     
Impacted Files Coverage Δ
middlewares/bodies.js 100.00% <ø> (ø)
middlewares/circles.js 100.00% <ø> (ø)
middlewares/generic.js 100.00% <ø> (ø)
lib/server.js 97.66% <60.00%> (-2.34%) ⬇️
lib/info.js 100.00% <100.00%> (ø)
lib/swaggerDef.js 100.00% <100.00%> (ø)

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 a456462...af8e6f9. Read the comment docs.

// NODE_ENV is specified.
exports.env = process.env.NODE_ENV || 'development';
exports.host = process.env.X_HOST || os.hostname();
exports.name = process.env.npm_package_name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we take it from ../package.json the same way as in /healthcheck?

// Endpoints not requiring authorization.
GeneralRouter.get('/api-docs.json', (req, res) => { // mini-route to retrieve the docs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move it to middlewares/ ? either to /middlewares/generic.js or create other file to store it

idea is that lib/server.js contains the routing (e.g. this route is served by these middlewares), and not the middlewares themselves (they are stored in middlewares/*

@WikiRik WikiRik marked this pull request as draft November 29, 2020 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants