Skip to content

Commit

Permalink
Update generate-new-code-using-ai.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello authored Jun 21, 2024
1 parent 9fc23ac commit 3e9b70a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/tutorials/generate-new-code-using-ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ sidebar_position: 50
Defang supports generating new project outlines using integration with an AI model. Using this feature, you can describe what you would like the service to do and the CLI will then generate a project outline with all the files required to make it work.
<iframe width="560" height="315" src="https://www.youtube.com/embed/afglsBYieuc?si=GCvHhBu3H9ktMDHA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## Step 1 - Use the CLI generate command

In this tutorial we'll use the following prompt:

A basic service with 2 REST endpoints. The default endpoint will be for health check and should return a JSON object like this: { "status": "OK" }. The /echo endpoint will echo back all request parameters in the response.

## Step 1 - Use the CLI generate command
```text
defang generate
Expand All @@ -30,7 +34,7 @@ project1

This will generate the different files required to start your project based on your prompt and the language selected.

## Step 3 - Review the Code
## Step 2 - Review the Code

Change into the new project folder:
```shell
Expand All @@ -39,7 +43,7 @@ cd project1

You can open the files in a code editor to review or make changes as needed before deploying the service.

## Step 4 - Build and Deploy
## Step 3 - Build and Deploy

```bash
defang compose up
Expand Down

0 comments on commit 3e9b70a

Please sign in to comment.