You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/tutorials/using-prisma-postgres-with-workers/index.mdx
+17-10Lines changed: 17 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ languages:
11
11
- PostgreSQL
12
12
---
13
13
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.
if(path==="/favicon.ico") returnnewResponse('Resource not found', {
166
-
status: 404,
167
-
headers: {
168
-
'Content-Type': 'text/plain'
169
-
}
170
-
});
171
-
164
+
const path =newURL(request.url).pathname;
165
+
if (path==="/favicon.ico")
166
+
returnnewResponse("Resource not found", {
167
+
status: 404,
168
+
headers: {
169
+
"Content-Type": "text/plain",
170
+
},
171
+
});
172
+
172
173
const prisma =newPrismaClient({
173
174
datasourceUrl: env.DATABASE_URL,
174
175
}).$extends(withAccelerate());
@@ -196,7 +197,13 @@ Run the development server:
196
197
npm run dev
197
198
```
198
199
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.
0 commit comments