본문으로 건너뛰기

Gateways

The Components you create are stored in the NEAR blockchain. To read and execute their code you will need a Gateway.

A Gateway is nothing but a Next.js application with the added ability of retrieving components from the blockchain and rendering their code.

This allow you to create the frontend of your application combining classic Next components with Web3 components that interact with your desired blockchain.


Building a Gateway

Building your own Gateway is as simple as cloning the example repository, and running it:

# Clone gateway
git clone git@github.com:near-examples/bos-gateway.git

# Install dependencies
cd bos-gateway
npm install

# Run the gateway
npm run dev
Configure the Gateway

Make sure to change the src/data/bos-components.ts file


Deploying Gateway in Vercel

NEAR BOS 게이트웨이 인스턴스를 시작하는 것은 빠르고 간단한 프로세스입니다. 이 예에서는 Vercel을 사용하여 새로운 BOS 게이트웨이를 구축하고 배포하지만, 다른 플랫폼도 사용할 수 있습니다.

다음과 같은 간단한 단계만 수행하면 됩니다:

  1. Clone the near/bos-gateway repository
  2. Vercel에 회원가입하고 복제된 레퍼지토리를 가져옵니다.
  3. 프로젝트를 설정합니다.
    • 팀 이름
    • 빌드 명령: npm run build
    • 출력 디렉토리: dist
  4. Deploy 누르기

이 링크를 클릭하여 사용해 보세요.

vercel setup

이제 Vercel이 웹 사이트를 구축할 때까지 몇 분만 기다리고, BOS 게이트웨이를 즐겨보세요!

사용자 정의
  • 특정 도메인에서 게이트웨이를 호스트하려면 Vercel에서 게이트웨이를 구성할 수 있습니다.

  • 홈 페이지 구성 요소를 변경하려면 포크 파일에서 src/data/widgets.js를 수정하여 다른 구성 요소를 가리킵니다.