How to set up a React app with Create React App and how to deploy it with 4everland.

React is a JavaScript library for building user interfaces. In this guide, we will cover how to set up a React app with Create React App and how to deploy it with 4everland.

Step 1: Set Up Your React Project

Start by setting up your React application using the Create React App (CRA) CLI tool. With this, you can generate a project to start and run React.

To create a new app, you may choose yarn, npx or npm, following is the method of npm:

 

If you would prefer other methods, please check Create React App (// Getting Started | Create React App) for more information.

Step 2: Deploying Your React Project with 4everland

To deploy a React project with 4everland for Git, make sure it has been pushed to GitHub repository.

Start a deployment, click on "Import", then select your connected Git account.

1. Setup Root Directory

Setup the root directory, for most of the project just keep it default, for monorepo, a sub directory could be selected, this is where npm install and build command runs.

2: Configurate Build Settings

A default framework should be selected after root directory is set. A framework would have default Build Commands and Output Directory, switch on Override to override default settings.

3: Environment Variables

Optionally, Set Environment Variables if required, which could be accessed via process.env.VARIABLE_NAME in your code.

4: Checkout build status

Build status:

  • Created: A new task is created
  • Queued: The task is pending in a queue, should be processed soon
  • Running: The task is running in progress
  • Success: All building steps, deployment steps is done
  • Failure: Exception/Error while building or deploy the sit

5: Checkout deployment history

  • Click on the logo to return to the project list
  • Click on a project to check out details
  • Click on Deployments on the navigation tab to checkout deployment histories

If the build steps failed and build settings needs to be updated, checkout Project Settings.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值