Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners committed Jun 10, 2022
1 parent 7856a01 commit 5242898
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/md-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
node-version: 'lts/*'

- name: Install Linter
run: npm i --no-save markdownlint-cli2
run: npm install

- name: Add Matcher
uses: xt0rted/markdownlint-problem-matcher@b643b0751c371f357690337d4549221347c0e1bc

- name: Run Linter
run: ./node_modules/.bin/markdownlint-cli2-config .github/.markdownlint-cli2.yaml
run: ./node_modules/.bin/markdownlint-cli2

File renamed without changes.
14 changes: 8 additions & 6 deletions docs/Reference/Routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,10 @@ Now your clients will have access to the following routes:
- `/v2/user`

You can do this as many times as you want, it also works for nested `register`,
and route parameters are supported as well.
and route parameters are supported as well.

In case you want to use prefix for all of your routes, you can put them inside a plugin:
In case you want to use prefix for all of your routes, you can put them inside a
plugin:

```js
const fastify = require('fastify')()
Expand All @@ -437,13 +438,13 @@ const route = {
method: 'POST',
url: '/login',
handler: () => {},
schema: {},
schema: {},
}

fastify.register(function(app, _, done) {
app.get('/users', () => {})
app.route(route)

done()
}, { prefix: '/v1' }) // global route prefix

Expand All @@ -454,8 +455,9 @@ await fastify.listen({ port: 0 })
<a id="fastify-plugin"></a>

Be aware that if you use
[`fastify-plugin`](https://github.com/fastify/fastify-plugin) for wrapping your routes, this option will
not work. You can still make it work by wrapping a plugin in a plugin, e. g.:
[`fastify-plugin`](https://github.com/fastify/fastify-plugin) for wrapping your
routes, this option will not work. You can still make it work by wrapping a
plugin in a plugin, e. g.:
```js
const fp = require('fastify-plugin')
const routes = require('./lib/routes')
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"coverage:ci": "npm run unit -- --cov --coverage-report=html --no-browser --no-check-coverage -R terse",
"coverage:ci-check-coverage": "nyc check-coverage --branches 100 --functions 100 --lines 100 --statements 100",
"license-checker": "license-checker --production --onlyAllow=\"MIT;ISC;BSD-3-Clause;BSD-2-Clause\"",
"lint": "npm run lint:standard && npm run lint:typescript",
"lint": "npm run lint:standard && npm run lint:typescript && npm run lint:markdown",
"lint:fix": "standard --fix",
"lint:markdown": "markdownlint-cli2",
"lint:standard": "standard | snazzy",
"lint:typescript": "eslint -c types/.eslintrc.json types/**/*.d.ts test/types/**/*.test-d.ts",
"prepublishOnly": "tap --no-check-coverage test/internals/version.test.js",
Expand Down Expand Up @@ -158,6 +159,7 @@
"json-schema-to-ts": "^2.5.3",
"JSONStream": "^1.3.5",
"license-checker": "^25.0.1",
"markdownlint-cli2": "^0.4.0",
"proxyquire": "^2.1.3",
"pump": "^3.0.0",
"self-cert": "^2.0.0",
Expand Down

0 comments on commit 5242898

Please sign in to comment.