0Pricing
Edge Computing with Cloudflare Workers & Deno · 강의

Deno Deploy 및 CLI

Deno Deploy를 활용하여 Deno 애플리케이션을 엣지에 직접 배포하고 고급 CLI 기능을 사용합니다.

Deno Deploy 및 CLI은(는) CoddyKit의 무료 Edge Computing with Cloudflare Workers & Deno 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Edge Computing with Cloudflare Workers & Deno 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Edge Computing with Cloudflare Workers & Deno 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Welcome to Deno Deploy

In this lesson, we'll dive into Deno Deploy, a powerful platform designed for deploying Deno applications directly to the edge. It's built by the Deno team itself!

Think of it as a serverless environment optimized specifically for Deno, offering incredible speed and global reach without complex setup.

Deno Deploy's Core Philosophy

Deno Deploy simplifies edge deployment by letting you run your Deno code without complex build steps or configuration. It focuses on:

  • Simplicity: Deploy with a single command.
  • Speed: Your applications run on a globally distributed network.
  • Deno-Native: Your Deno code runs as-is, no transpilation needed.

This means less overhead and faster development cycles compared to other edge platforms.

Getting Started with Deno Deploy CLI

To deploy your Deno application, you'll primarily use the deno deploy command-line interface (CLI). First, ensure you have Deno installed.

You'll also need a Deno Deploy account to link your deployments. It's free to get started!

The CLI handles authentication and project management for you.

Your First Edge Function

Let's create a simple Deno HTTP server. Save this code as main.ts. It will respond with 'Hello from Deno Deploy!' when accessed.

This is a complete, runnable Deno program, ready for the edge:

import { serve } from "https://deno.land/std@0.210.0/http/server.ts";

const handler = (_req: Request): Response => {
  return new Response("Hello from Deno Deploy!");
};

serve(handler, { port: 8000 });
console.log("Server running on http://localhost:8000/");

Deploying Your Application

Once you have your Deno code (like main.ts), deploying it is straightforward. You'll use the deno deploy command.

You can create a project via the Deno Deploy dashboard or let the CLI create one for you.

Example deployment command:

deno deploy --project=<your-project-name> main.ts

Monitoring with Deno Deploy CLI

After deployment, you'll want to check its status and view logs. The Deno Deploy CLI provides convenient commands for this:

  • deno deploy status [project-name]: Shows information about your project's deployments, including URLs and status.
  • deno deploy logs [project-name]: Streams real-time logs from your running application, vital for debugging.

These tools are crucial for maintaining and debugging your edge functions.

Environment Variables & Secrets

Edge applications often need configuration or secrets (like API keys). Deno Deploy supports environment variables for this.

You define these variables in your project's settings on the Deno Deploy dashboard. They are securely injected into your application's runtime.

In your Deno code, you access them using Deno.env.get("VAR_NAME").

Using Environment Variables in Code

Let's update our Deno server to use an environment variable. Imagine we set GREETING_MESSAGE in the Deno Deploy dashboard.

This makes your application more flexible and secure by separating configuration from code:

import { serve } from "https://deno.land/std@0.210.0/http/server.ts";

const greeting = Deno.env.get("GREETING_MESSAGE") || "Hello from default!";

const handler = (_req: Request): Response => {
  return new Response(greeting);
};

serve(handler, { port: 8000 });
console.log("Server running on http://localhost:8000/");

Advanced Deployment Options

Deno Deploy offers more advanced features to enhance your workflow and application:

  • Git Integration: Connect your GitHub repository for automatic deployments on every push.
  • Custom Domains: Map your own domain names to your deployed applications for brand consistency.
  • Production Flag: Use --production with the CLI for optimized production deployments.

These features streamline your CI/CD pipeline and improve the user experience.

Deno Deploy CLI Question

Which of the following commands would you use to view real-time logs from your deployed Deno Deploy application?

Recap: Deno Deploy & CLI

You've learned about Deno Deploy, a Deno-native platform for edge deployment. We covered:

  • Its core benefits: simplicity, speed, and Deno-native execution.
  • Using the deno deploy CLI for simple and advanced deployments.
  • Managing environment variables for secure configuration.
  • Monitoring your applications with deno deploy status and logs.

Deno Deploy offers a powerful, streamlined way to bring your Deno applications directly to the edge!

자주 묻는 질문

“Deno Deploy 및 CLI” 강의는 무료인가요?

네 — “Deno Deploy 및 CLI” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Edge Computing with Cloudflare Workers & Deno 강의 전체를 잠금 해제할 수 있습니다. Edge Computing with Cloudflare Workers & Deno 강의에는 총 4개의 강의가 포함되어 있습니다.

“Deno Deploy 및 CLI”에서 뭘 배우나요?

Deno Deploy를 활용하여 Deno 애플리케이션을 엣지에 직접 배포하고 고급 CLI 기능을 사용합니다. 브라우저에서 직접 실행하는 실습 코드로 Edge Computing with Cloudflare Workers & Deno을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Edge Computing with Cloudflare Workers & Deno을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Edge Computing with Cloudflare Workers & Deno은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.

“Deno Deploy 및 CLI” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Edge Computing with Cloudflare Workers & Deno 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Edge Computing with Cloudflare Workers & Deno 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. Deno Deploy 및 CLI
  2. 사용자 지정 런타임 환경
  3. 엣지를 위한 테스트 및 CI/CD
  4. 블루-그린 및 점진적 배포
← Edge Computing with Cloudflare Workers & Deno(으)로 돌아가기