LoginSignup
0
0

More than 5 years have passed since last update.

nasa space apps challenge その8

Posted at

概要

nasa space apps challenge に行けないので、勝手にハッカソンしてみる。
他のサイトからajaxするために、node-redでクロスドメイン対策した。

写真

func0

msg.url = msg.payload.url;
return msg;

func1

msg.res.header('Access-Control-Allow-Origin', '*');
msg.res.send(msg.payload);
return msg;

サンプルコード

$.ajax({
    type: 'get',
    url: 'http://node-red /proxy?url=www.data4citizen.jp/app/users/openDataOutput/json/get/aizuwakamatsu_map',
    success: function(res) {
        alert('success');
    },
    error: function(res) {
        alert('err!');
    }
});
0
0
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
0
0