Skip to content

Commit 2cdddab

Browse files
committed
chore: add more clarity
1 parent 25e15eb commit 2cdddab

File tree

1 file changed

+17
-10
lines changed
  • src/content/docs/workers/tutorials/using-prisma-postgres-with-workers

1 file changed

+17
-10
lines changed

src/content/docs/workers/tutorials/using-prisma-postgres-with-workers/index.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ languages:
1111
- PostgreSQL
1212
---
1313

14-
[Prisma Postgres](https://www.prisma.io/postgres) is a managed, serverless PostgreSQL database. It supports features like connection pooling, caching, real-time subscriptions, and query optimization recommendations.
14+
[Prisma Postgres](https://www.prisma.io/postgres) is a managed, serverless PostgreSQL database. It supports features like connection pooling, caching, real-time subscriptions, and query optimization recommendations.
1515

1616
In this tutorial, you will learn how to:
1717

@@ -161,14 +161,15 @@ export interface Env {
161161

162162
export default {
163163
async fetch(request, env, ctx): Promise<Response> {
164-
const path = (new URL(request.url)).pathname;
165-
if(path === "/favicon.ico") return new Response('Resource not found', {
166-
status: 404,
167-
headers: {
168-
'Content-Type': 'text/plain'
169-
}
170-
});
171-
164+
const path = new URL(request.url).pathname;
165+
if (path === "/favicon.ico")
166+
return new Response("Resource not found", {
167+
status: 404,
168+
headers: {
169+
"Content-Type": "text/plain",
170+
},
171+
});
172+
172173
const prisma = new PrismaClient({
173174
datasourceUrl: env.DATABASE_URL,
174175
}).$extends(withAccelerate());
@@ -196,7 +197,13 @@ Run the development server:
196197
npm run dev
197198
```
198199

199-
Visit [`https://localhost:8787`](https://localhost:8787) to see your app in action.
200+
Visit [`https://localhost:8787`](https://localhost:8787) to see your app display the following output:
201+
202+
```sh
203+
Number of users in the database: 1
204+
```
205+
206+
Every time you refresh the page, a new user is created. The number displayed will increment by `1` with each refresh as it returns the total number of users in your database.
200207

201208
## 4. Deploy the application to Cloudflare
202209

0 commit comments

Comments
 (0)