Skip to content

Commit 23fcbc1

Browse files
authored
docs: Update Fastify listen() calls to use { port: 3000 } in docs and examples (#1023)
1 parent 759a405 commit 23fcbc1

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

docs/docs/examples/react-ssr.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fastify.get('/', async () => fastify.runTask({ name: 'James' }));
228228
// Run the server!
229229
const start = async () => {
230230
try {
231-
await fastify.listen(3000);
231+
await fastify.listen({ port: 3000 });
232232
} catch (err) {
233233
process.exit(1);
234234
}
@@ -267,7 +267,7 @@ fastify.get('/', async () => fastify.runTask({ name: 'James' }, { name: 'renderP
267267
// Run the server!
268268
const start = async () => {
269269
try {
270-
await fastify.listen(3000);
270+
await fastify.listen({ port: 3000 });
271271
} catch (err) {
272272
process.exit(1);
273273
}
@@ -321,7 +321,7 @@ fastify.get('/', async () => {
321321
// Run the server!
322322
const start = async () => {
323323
try {
324-
await fastify.listen(3000);
324+
await fastify.listen({ port: 3000 });
325325
} catch (err) {
326326
process.exit(1);
327327
}

examples/react-ssr/pooled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fastify.get('/', async () => fastify.run({ name: 'James' }));
1616
// Run the server!
1717
const start = async () => {
1818
try {
19-
await fastify.listen(3000);
19+
await fastify.listen({ port: 3000 });
2020
} catch (err) {
2121
process.exit(1);
2222
}

examples/react-ssr/unpooled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fastify.get('/', async () => {
2727
// Run the server!
2828
const start = async () => {
2929
try {
30-
await fastify.listen(3000);
30+
await fastify.listen({ port: 3000 });
3131
} catch (err) {
3232
process.exit(1);
3333
}

examples/server/async-sleep-pooled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fastify.get('/', () => fastify.run());
1818
// Run the server!
1919
const start = async () => {
2020
try {
21-
await fastify.listen(3000);
21+
await fastify.listen({ port: 3000 });
2222
} catch (err) {
2323
process.exit(1);
2424
}

examples/server/async-sleep-unpooled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fastify.get('/', async () => {
1313
// Run the server!
1414
const start = async () => {
1515
try {
16-
await fastify.listen(3000);
16+
await fastify.listen({ port: 3000 });
1717
} catch (err) {
1818
process.exit(1);
1919
}

examples/server/sync-sleep-pooled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fastify.get('/', () => fastify.run());
1818
// Run the server!
1919
const start = async () => {
2020
try {
21-
await fastify.listen(3000);
21+
await fastify.listen({ port: 3000 });
2222
} catch (err) {
2323
process.exit(1);
2424
}

examples/server/sync-sleep-unpooled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fastify.get('/', async () => {
1414
// Run the server!
1515
const start = async () => {
1616
try {
17-
await fastify.listen(3000);
17+
await fastify.listen({ port: 3000 });
1818
} catch (err) {
1919
process.exit(1);
2020
}

0 commit comments

Comments
 (0)