LoginSignup
1
1

More than 5 years have passed since last update.

node-red でプログラムの インポート、イクスポート

Last updated at Posted at 2017-07-16

インポートするプログラムは、
.node-red/lib/flows に 置きます。

.node-red/lib/flows/http01.json
[
  {
    "id": "e0046ab2.11aec",
    "type": "http in",
    "z": "d3c92838.0aca08",
    "name": "",
    "url": "/testa",
    "method": "get",
    "upload": false,
    "swaggerDoc": "",
    "x": 100,
    "y": 150,
    "wires": [
      [
        "15433e15.724bda"
      ]
    ]
  },
  {
    "id": "15433e15.724bda",
    "type": "template",
    "z": "d3c92838.0aca08",
    "name": "",
    "field": "payload",
    "fieldType": "msg",
    "format": "handlebars",
    "syntax": "mustache",
    "template": "Hello!<br />\n本日は晴天なり<br />\n<blockquote>\n    Jul/16/2017 PM 14:58<p />\n</blockquote>",
    "output": "str",
    "x": 250,
    "y": 150,
    "wires": [
      [
        "e70a7bef.77fcf"
      ]
    ]
  },
  {
    "id": "e70a7bef.77fcf",
    "type": "http response",
    "z": "d3c92838.0aca08",
    "name": "",
    "statusCode": "",
    "headers": {},
    "x": 400,
    "y": 150,
    "wires": []
  }
]

node-red で、
読み込み -> ライブラリ -> http01
で読み込むと、

node-red_jul1601.png

これを、実行して、ブラウザーで
http://127.0.0.1:1880/testa/ にアクセスします。

node-red_jul1602.png

プログラムを変更して、イクスポートするには、

編集をして、デプロイする前の状態で、書き出すノードを選び、
書き出し -> ライブラリ とすすみます。

node-red_jul1603.png

.node-red/lib/flows に *.json という形で書き出されます。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1