서버를 사용하지 않는 갤러리와 빠르게 빌드 웹 사이트

이 문서에서는 처음 등장 서버를 사용하지 않는 중국어 네트워크를 재 인쇄를 들어, 원래 저자 및 소스를 보관 해주십시오.

일상 생활 우리는 종종 등 일부 비디오, 사진, 촬영, 이러한 파일은 더 많은 저장 공간을 차지합니다. 이 문서에서는 방법을 설명 : 저장 공간의 압축 해제를위한 개인 사진 앨범 사이트를 구축하기 위해 빠른 구성 요소 서버를 사용하지 않는 프레임 워크와 함께 엄지 손가락 도구를 사용하여.

도구 설명 :

  • 프레임 워크 서버를 사용하지 않는이 : 서버를 사용하지 않는 프레임 워크는 업계의 인기 서버 응용 프로그램 프레임 워크 개발자는 완벽한 애플리케이션 아키텍처 서버를 사용 가능 배포하는 기본 자원에 대한 상관 없어.

  • 엄지 손가락은 A가 편리하게 사용자가 검색하고 플러그인 소프트웨어뿐만 아니라 간단한 이미지 처리 및 이미지 사진 스위치 조작 사용 인터페이스의 빠른 미리보기를 할 수도있다 상당한 직접적이고 편리한 조작의 사진을 관리 할 수 있습니다.

전체 사이트는 세 단계의 배포를 구축 : 설치 및 초기화 파일 → → 구성 YML 배포를.

설치 및 초기화

첫째, 시스템은 다음과 같은 환경으로 구성되어 있는지 확인하십시오

응용 프로그램이 설치되어 있지 않은, 당신은 참조 할 수 있습니다 설치 지침 .

서버를 사용하지 프레임 워크를 설치 (1)

$ npm install -g serverless

엄지 손가락을 설치합니다

$ npm install -g thumbsup

3. 초기화 프로젝트

$ md photos
$ thumbsup --input .\photos\ --output website

초기화 후에는 프로젝트 디렉토리 구조를 볼 수 있습니다

.
├── photos
└── website
    └── index.html

YML 구성 파일

프로젝트 디렉토리 아래에서 만들 serverless.yml파일을

cd.> serverless.yml

위의 YML 파일에 다음을 기록합니다 :

# serverless.yml

myWebsite:
  component: "@serverless/tencent-website"
  inputs:
    code:
      src: ./website
      index: index.html
      error: index.html
    region: ap-guangzhou
    bucketName: my-bucket-1111

일단 구성되면, 파일 디렉토리는 다음과 같습니다 :

.
├── photos
├── website
|   └── index.html
└── serverless.yml

배포

관통 sls배치 명령, 당신은 추가 할 수 있습니다 --debug배포시 뷰 정보에 매개 변수를

계정이없는 경우 로그인 또는 등록 텐센트 구름, 당신이 로그인 할 수 있습니다 직접 두 차원 코드 스캔 마이크로 편지 명령 줄 승인 레지스터.

sls --debug

  DEBUG ─ Resolving the template's static variables.
  DEBUG ─ Collecting components from the template.
  DEBUG ─ Downloading any NPM components found in the template.
  DEBUG ─ Analyzing the template's components dependencies.
  DEBUG ─ Creating the template's components graph.
  DEBUG ─ Syncing template state.
  DEBUG ─ Executing the template's components graph.
  DEBUG ─ Starting Website Component.
  DEBUG ─ Preparing website Tencent COS bucket my-bucket-thumbsup-1256386184.
  DEBUG ─ Deploying "my-bucket-thumbsup-1256386184" bucket in the "ap-guangzhou" region.
  DEBUG ─ "my-bucket-thumbsup-1256386184" bucket was successfully deployed to the "ap-guangzhou" region.
  DEBUG ─ Setting ACL for "my-bucket-thumbsup-1256386184" bucket in the "ap-guangzhou" region.
  DEBUG ─ Ensuring no CORS are set for "my-bucket-thumbsup-1256386184" bucket in the "ap-guangzhou" region.
  DEBUG ─ Ensuring no Tags are set for "my-bucket-thumbsup-1256386184" bucket in the "ap-guangzhou" region.
  DEBUG ─ Configuring bucket my-bucket-thumbsup-1256386184 for website hosting.
  DEBUG ─ Uploading website files from D:\tencent-serverless\thumbsup\website to bucket my-bucket-thumbsup-1256386184.
  DEBUG ─ Starting upload to bucket my-bucket-thumbsup-1256386184 in region ap-guangzhou
  DEBUG ─ Uploading directory D:\tencent-serverless\thumbsup\website to bucket my-bucket-thumbsup-1256386184
  DEBUG ─ Website deployed successfully to URL: http://my-bucket-thumbsup-1256386184.cos-website.ap-guangzhou.myqcloud.com.

  myWebsite:
    url: http://my-bucket-thumbsup-1256386184.cos-website.ap-guangzhou.myqcloud.com
    env:

  13s » myWebsite » done

액세스 웹 사이트 URL 명령 라인 출력, 당신은 사이트 서버를 사용하지 않는 프레임 워크 구축의 사용을 볼 수있는 사진 벽을 볼 수 있습니다.

엄지 손가락

참고 :이 웹 사이트의 사진 또는 비디오 파일을 업데이트하려면 사진이 로컬 다시 실행에 폴더 후, 당신은 사진을 업데이트 할 수 있습니다 thumbsup --input .\photos\ --output website, 로컬 페이지를 업데이트 한 다음 실행 sls사이트를 업데이트 할 수 있습니다.

개요

본 명세서에서 사용 된 바와 같이, 매우 인기가 아닌 서버 프레임 워크 서버를 사용하지 않는 프레임 워크 빌드 사진 벽 사이트는 제품 정보를 입력하기 위해 클릭 할 수있는 공식 웹 사이트를 배울 수 있습니다.

참조 :

당신은 또한 방문 할 수 있습니다 : 서버를 사용하지 않는 중국 기술 커뮤니티모범 사례 응용 프로그램에 서버를 사용하지 않는 열을 더 발전을 볼 수 있습니다!

추천

출처www.cnblogs.com/serverlesscloud/p/12173470.html