Giter Site home page Giter Site logo

chipsnet / switch-bot-cloudflare-pages Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 11 KB

SwitchBotのライトを第三者に制御させる簡単な方法

License: Mozilla Public License 2.0

JavaScript 45.22% HTML 54.78%
cloudflare cloudflare-pages cloudflare-pages-functions switchbot-api

switch-bot-cloudflare-pages's Introduction

switch-bot-cloudflare-pages

Webから第三者に勝手に自分の家の電気を操作可能にするWebサイトです。
Cloudflare Pages + Pages functionsを利用することで、APIトークンを外部に漏らすことなく安全に、かつ無料で公開することができます。

Requirements

  • Cloudflare Account

Get API token and deviceId

こちらのサイトを参考に、認証用トークンとdeviceIdを取得します。

Deploy to Cloudflare pages

Open cloudflare pages page

Cloudflare Pagesのタブを開きます。

Connect to git repos

プロジェクト作成 > Gitに接続をクリックします。

Select this repos

Gitの認証を行っていない場合は認証して、このGitリポジトリを選択します。

put build dir "src"

ビルド出力ディレクトリに src と入力します。

Setting up env value

環境変数に以下の項目を設定します

変数名
TOKEN 取得した認証用トークン
deviceId 取得したデバイスID

保存してデプロイすれば公開は完了です。

Support me!

ko-fi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.