Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 1.87 KB

File metadata and controls

59 lines (38 loc) · 1.87 KB

React

1-click-deploy

This sample shows how to get a simple React app up and running with Defang. It includes Vite and ESLint, which are common build tools for React development.

Prerequisites

  1. Download Defang CLI
  2. (Optional) If you are using Defang BYOC authenticate with your cloud provider account
  3. (Optional for local development) Docker CLI

Development

To run the application locally, you can use the following command (make sure you've got npm and Node.js installed):

npm install
npm run dev

To run it using a Docker container, you can use the following command:

docker compose up --build

Deployment

Note

Download Defang CLI

Defang Playground

Deploy your application to the Defang Playground by opening up your terminal and typing:

defang compose up

BYOC (AWS)

If you want to deploy to your own cloud account, you can use Defang BYOC:

  1. Authenticate your AWS account, and check that you have properly set your environment variables like AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY.
  2. Run in a terminal that has access to your AWS environment variables:
    defang --provider=aws compose up

Title: React

Short Description: A minimal React app running on Defang.

Tags: React, Vite, JavaScript, Frontend

Languages: JavaScript