- [Instructor] To get started with this course,
I have provided exercise files
so you can work along with me.
I also have a few tips for you to set up your environment,
as well as steps to get the API key
that's necessary to work through this course.
If you have access to the exercise files,
there's a directory for each chapter
and a sub-folder for each video.
The Start folder contains the files you should use
to work through the tasks in the video.
The Finish folder contains the same files
with all of the tasks in the video completed.
If you get stuck or just can't get a step to work,
the Finish files can be a great way to check your work
or to see the finished product in action.
If you're viewing this course on a mobile device
or a set-top device, or if your membership
doesn't provide access to the exercise files, that's okay.
I encourage you to still follow along
as we go through the course.
If you are working on a computer,
you need three applications:
a web browser, a code editor, and an HTTP server.
You also need an API key from openweathermap.org.
You undoubtedly already have a web browser
installed on your machine and any major modern browser,
Chrome, Firefox, or Microsoft Edge,
is fine for this course.
I'll be using Chrome in these videos,
which is a popular choice among web developers
because of the extensive and powerful developer tools
it has built in.
Because we'll only be using the console though,
that won't really make a difference for this course.
Note that if you're on a Mac
and you want to use Safari,
you'll need to go to the Preferences,
select the Advanced tab
and check the Show Develop menu in menu bar check box
in order to be able to access the developer tools
using the menu.
You'll then have a menu option called Develop,
which gives you access to all these different tools.
A number of great code editors are available
with both free and paid apps.
Any editor that lets you edit and save plain text
is fine for this course,
so if you have a code editor you like,
such as Sublime Text or Atom, it's fine to use it.
I use Visual Studio Code in these videos,
which is a version of Microsoft's Visual Studio
that was created specifically for web development.
Visual Studio Code is free
and has Windows, Mac, and Linux releases.
The Code is available on GitHub
and users can submit issues there as well.
I've customized my editor with one extension.
Open in Browser, created by TechER,
lets you open the current HTML file
directly in your default browser
using the alt + b or option + b keyboard shortcut.
So this just saves a trip to the file manager
to open a file in the browser the first time.
An HTTP server is the final tool you need for this course.
As a web developer, this is an application
you'll need to have access to.
So if you don't have one installed at this point,
use this as your excuse to install it.
I'm using http-server,
which is a command-line utility that runs under Node
and is installed through the Node Package Manager, or NPM.
You can install Node by downloading a GUI installer
from nodejs.org.
Then once that's installed, at the command line,
you simply type npm install
http-server -g,
where -g installs the package globally.
Now, if you run into errors like this,
you may need to use sudo to install this package.
To do so, you use the same command,
but you type sudo at the start of it.
So sudo npm install,
http-server -g.
and you type in your login password.
And then I have a good install.
Once that install is complete,
you can use the command http-server to start a server
that serves the files in the current directory.
And then when you're done,
just press control + C and you're back to the Bash prompt.
Finally, the videos in this course make use of data
from openweathermap.org.
Data requests from this service require an API key,
which is a unique identifier that associates you
with the request coming in.
The service provides a limited amount of data for free.
And by having your own key,
you can ensure you stay below the limit of free requests.
To do this, you need to sign up for an account
with openweathermap.org and obtain an API key,
which you'll use when creating your AJAX requests for data.
So let's set that up now.
Openweathermap.org makes weather information available
under a creative commons license.
Data is free for up to 60 requests a minute,
which will work fine for this course.
It's only more intensive uses
that require a paid subscription.
To get an API key, go to openweathermap.org in your browser.
Then in the menu, click API.
This documents the terms as well as endpoints
you can hit with your AJAX requests.
Click the API key link.
And then on the page that opens, click the sign up button
and in the Create New Account box,
you're going to create a unique username
And I'm going to use closurescourse,
going to enter an email address,
and then you're going to enter a password
of at least eight characters
in both boxes.
And you can read the terms of service
and the privacy policy,
and then check this box.
I'm going to opt out of receiving emails.
I am not a robot.
And then I click Create Account.
And so there's a question here.
I'm just going to cancel out of that.
Next, a page opens showing you information
about your account.
And here in the menu, I'm going to click the API keys tab.
So down here under the key heading
is an alphanumeric string, which is your API key.
And that's going to identify your account
when you make a request to the OpenWeatherMap API.
So I'm going to select this value
and I'm going to copy it to the clipboard.
And then I want to put it somewhere
I can access it easily,
and I'm on a Mac, so I'm going to open up the Notes app,
and I'm going to create a new Note.
I'm going to type open weather map API key,
and then paste it in.
And so that's my OpenWeatherMap API key.
Now the key you'll see me using in the videos
for this course has been deactivated.
So it's important that you use your own key
because this one won't work.
Now, whenever you need access to your API key
during this course, you can just go back
to the note you created,
copy the text of the key and continue coding.
Now, let's get started.