项目作者: phodal

项目描述 :
A Serverless IoT Server for Fun
高级语言: JavaScript
项目地址: git://github.com/phodal/bracket.git
创建时间: 2018-02-26T06:01:11Z
项目社区:https://github.com/phodal/bracket

开源协议:MIT License

下载


Bracket

A Serverless IoT Server for Fun

Features

  • On/Off Toggle
  • JSON support
  • Wechat Control
  • AWS IoT?

On/Off Toggle

Action HTTP Method URL Response
create POST /q {“uuid”:”HyOPYVfOf”}
on GET /q/{device_id}/on {“results”:”succeeded”,”status”:1}
off GET /q/{device_id}/off {“results”:”succeeded”,”status”:0}
status GET /q/{device_id} {“status”:0}
status GET /q/{device_id}/status {“status”:0}

Examples

Create

  1. $ curl -X POST https://iot.pho.im/q
  2. {"uuid":"H1qG3tQ_M"}

On/Off

  1. $ curl -X GET https://iot.pho.im/q/H1qG3tQ_M/on
  2. {"results":"succeeded","status":1}

Status

  1. $ curl -X GET curl -X GET https://iot.pho.im/q/H1qG3tQ_M/status
  2. {"status":1}

Setup

  1. npm install -g serverless

1.install

  1. yarn install

2.create domain

  1. sls create_domain

3.deloy

  1. sls deploy

LICENSE

Phodal's Idea

© 2018 A Phodal Huang‘s Idea. This code is distributed under the MIT license. See LICENSE in this directory.