Skip to content

meganedotin/js-from-zero-ch2

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

お天気ダッシュボード

0(ゼロ)から始めるJavaScriptによるWebアプリ開発入門 Ch2 非同期お天気webアプリを作る!

準備

このリポジトリにあるソースコードを取得します。

$ cd ~/Desktop/
$ git clone https://github.com/meganedotin/js-from-zero-ch2.git
$ cd js-from-zero-ch2/
$ npm install

メモ: 上記はデスクトップで作業する場合です。他のフォルダの場合は、最初の行を読み替えましょう。

APIキーを取得する

この例では、お天気情報を取得するのに、OpenWeatherMapのAPIを使います。

  1. サインアップ
  2. APIキーを確認

APIキーを設定

src/app.tagを開き、下記のxxxxxx...の箇所を、先ほど調べたAPIキーで置き換えます。

this.apikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

実行してみる

$ npm start

サーバを止めるには、キーボードでCtl + Cを押します。

ライセンス

MIT © Tsutomu Kawamura

About

[WIP] Ch2 非同期お天気webアプリを作る!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published