Skip to content

Commit

Permalink
clean up steps and results
Browse files Browse the repository at this point in the history
  • Loading branch information
ruheni committed Nov 7, 2023
1 parent e89dbd3 commit dc162bc
Showing 1 changed file with 19 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This guide demonstrates how to deploy an application to Deno Deploy in conjuncti

To start, you create a directory for your project, and then use `deno run` to initialize your application with `prisma init` as an [npm package with npm specifiers](https://deno.land/manual/node/npm_specifiers).

### Steps
To set up your application:

1. Open your terminal and navigate to a location of your choice.
2. Run the following commands to set up your application.
Expand Down Expand Up @@ -81,8 +81,6 @@ To start, you create a directory for your project, and then use `deno run` to in

With the data model in place and your database connection configured, you can now apply the data model to your database.

### Steps

```terminal
deno run -A npm:prisma migrate dev --name init
```
Expand Down Expand Up @@ -112,8 +110,6 @@ deno run -A npm:prisma generate --accelerate

</Admonition>

### Result

You now have a database schema and a locally generated Prisma Client for the Prisma Accelerate.

## 4. Create your application
Expand Down Expand Up @@ -175,7 +171,7 @@ With the Accelerate connection string copied, you can replace the existing conne

Prisma Client does not read `.env` files by default on Deno, so you must also install `dotenv-cli` locally.

### Steps
To configure Prisma Accelerate:

1. Install the `dotenv-cli`.

Expand All @@ -191,46 +187,38 @@ Prisma Client does not read `.env` files by default on Deno, so you must also in
# DATABASE_URL="postgres://..."
```

### Result

The configuration of your local environment is now ready to send Prisma queries to the database through Prisma Accelerate.

## 7. Test your application locally

You can now start your application locally and test the creation of log entries.

### Steps

1. Run your script locally.

```terminal
npx dotenv -- deno run -A ./index.ts
```
```terminal
npx dotenv -- deno run -A ./index.ts
```

2. In a web browser, open [http://localhost:8000/](http://localhost:8000/). This page writes your request to the database.
In a web browser, open [http://localhost:8000/](http://localhost:8000/). This page writes your request to the database.

```
{
"id": 3,
"level": "Info",
"message": "GET http://localhost:8000/",
"meta": {
"headers": "{}"
}
}
```

3. Reload the page a few times.<br /><br />Every time you reload, the script generates a new log entry and the id of the current log entry increments.
```
{
"id": 3,
"level": "Info",
"message": "GET http://localhost:8000/",
"meta": {
"headers": "{}"
}
}
```

### Result
Reload the page a few times.<br /><br />Every time you reload, the script generates a new log entry and the id of the current log entry increments.

This confirms that your application works when you run it from your local environment.

## 8. Create a repository and push to GitHub

You need a GitHub repository to add your project to Deno Deploy and enable automated deployments whenever you push changes.

### Steps
To set up a GitHub repository:

1. [Create a private GitHub repository](https://github.com/new).

Expand All @@ -254,9 +242,7 @@ Optionally, you can now also [link your GitHub repository to your project](/data

## 9. Deploy to Deno Deploy

Use the GitHub repository to add your application to Deno Deploy.

### Steps
Use the GitHub repository to add your application to Deno Deploy:

1. Go to [https://dash.deno.com/new](https://dash.deno.com/new).
1. Select a GitHub organization or user and then select a repository.
Expand All @@ -269,8 +255,6 @@ Use the GitHub repository to add your application to Deno Deploy.
1. Click **Link**.<br />
Wait for the first Deno deployment to finish.

### Result

When the first deployment finishes, your browser is redirected to the project view.

### What's next
Expand Down

0 comments on commit dc162bc

Please sign in to comment.