Skip to content

Commit 04b0fae

Browse files
docs: Emphasizing the monolythic approach in generated plugin README (#736)
* docs: Emphasizing the monolythic approach in generated plugin README * fix: typo * docs: avoid redundancy
1 parent f55734c commit 04b0fae

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

templates/app-esm/routes/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Routes Folder
22

3-
Routes define routes within your application. Fastify provides an
4-
easy path to a microservice architecture, in the future you might want
5-
to independently deploy some of those.
3+
Routes define the pathways within your application.
4+
Fastify's structure supports the modular monolith approach, where your
5+
application is organized into distinct, self-contained modules.
6+
This facilitates easier scaling and future transition to a microservice architecture.
7+
In the future you might want to independently deploy some of those.
68

79
In this folder you should define all the routes that define the endpoints
810
of your web application.
@@ -13,7 +15,7 @@ typically stored in a file; be careful to group your routes logically,
1315
e.g. all `/users` routes in a `users.js` file. We have added
1416
a `root.js` file for you with a '/' root added.
1517

16-
If a single file become too large, create a folder and add a `index.js` file there:
18+
If a single file becomes too large, create a folder and add a `index.js` file there:
1719
this file must be a Fastify plugin, and it will be loaded automatically
1820
by the application. You can now add as many files as you want inside that folder.
1921
In this way you can create complex routes within a single monolith,
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Routes Folder
22

3-
Routes define endpoints within your application. Fastify provides an
4-
easy path to a microservice architecture, in the future you might want
5-
to independently deploy some of those.
3+
Routes define the pathways within your application.
4+
Fastify's structure supports the modular monolith approach, where your
5+
application is organized into distinct, self-contained modules.
6+
This facilitates easier scaling and future transition to a microservice architecture.
7+
In the future you might want to independently deploy some of those.
68

79
In this folder you should define all the routes that define the endpoints
810
of your web application.
@@ -13,7 +15,7 @@ typically stored in a file; be careful to group your routes logically,
1315
e.g. all `/users` routes in a `users.js` file. We have added
1416
a `root.js` file for you with a '/' root added.
1517

16-
If a single file become too large, create a folder and add a `index.js` file there:
18+
If a single file becomes too large, create a folder and add a `index.js` file there:
1719
this file must be a Fastify plugin, and it will be loaded automatically
1820
by the application. You can now add as many files as you want inside that folder.
1921
In this way you can create complex routes within a single monolith,
@@ -22,3 +24,6 @@ and eventually extract them.
2224
If you need to share functionality between routes, place that
2325
functionality into the `plugins` folder, and share it via
2426
[decorators](https://fastify.dev/docs/latest/Reference/Decorators/).
27+
28+
If you're a bit confused about using `async/await` to write routes, you would
29+
better take a look at [Promise resolution](https://fastify.dev/docs/latest/Reference/Routes/#promise-resolution) for more details.

templates/app-ts/src/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const app: FastifyPluginAsync<AppOptions> = async (
3131
dir: join(__dirname, 'routes'),
3232
options: opts
3333
})
34-
3534
};
3635

3736
export default app;

templates/app-ts/src/routes/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Routes Folder
22

3-
Routes define endpoints within your application. Fastify provides an
4-
easy path to a microservice architecture, in the future you might want
3+
Routes define the pathways within your application.
4+
Fastify's structure supports the modular monolith approach, where your
5+
application is organized into distinct, self-contained modules.
6+
This facilitates easier scaling and future transition to a microservice architecture.
7+
In the future you might want
58
to independently deploy some of those.
69

710
In this folder you should define all the routes that define the endpoints
@@ -13,7 +16,7 @@ typically stored in a file; be careful to group your routes logically,
1316
e.g. all `/users` routes in a `users.js` file. We have added
1417
a `root.js` file for you with a '/' root added.
1518

16-
If a single file become too large, create a folder and add a `index.js` file there:
19+
If a single file becomes too large, create a folder and add a `index.js` file there:
1720
this file must be a Fastify plugin, and it will be loaded automatically
1821
by the application. You can now add as many files as you want inside that folder.
1922
In this way you can create complex routes within a single monolith,
@@ -22,3 +25,6 @@ and eventually extract them.
2225
If you need to share functionality between routes, place that
2326
functionality into the `plugins` folder, and share it via
2427
[decorators](https://fastify.dev/docs/latest/Reference/Decorators/).
28+
29+
If you're a bit confused about using `async/await` to write routes, you would
30+
better take a look at [Promise resolution](https://fastify.dev/docs/latest/Reference/Routes/#promise-resolution) for more details.

templates/app/routes/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Routes Folder
22

3-
Routes define routes within your application. Fastify provides an
4-
easy path to a microservice architecture, in the future you might want
5-
to independently deploy some of those.
3+
Routes define the pathways within your application.
4+
Fastify's structure supports the modular monolith approach, where your
5+
application is organized into distinct, self-contained modules.
6+
This facilitates easier scaling and future transition to a microservice architecture.
7+
In the future you might want to independently deploy some of those.
68

79
In this folder you should define all the routes that define the endpoints
810
of your web application.

0 commit comments

Comments
 (0)