Welcome to our advanced JavaScript chapter here on Async and Multi-threading Functionality. And the first thing we want to do to get set up, if you'd like to follow along with the exercises in this chapter, there's certainly a variety of ways to get yourself a web service or something that passes for a web service because we're going to be doing Ajax calls and promises and Async and we want to be able to have something we can call to get ourselves some information. So what I use is Visual Studio. This is Visual Studio community, freely available, free download on the web. And what I'm going to do is in just a couple minutes here, I'm going to create a project that has a service that we can call. So we'll create it first, and then we'll add some structure to it so that we can do some things with it later. So I'm going to create a brand new project. And in the Microsoft world, there is one web application that we add functionality to. So I'm just going to choose asp.net core web application. That's the current version of.net and call it whatever we want to call it there. And when I get to this place, this is where I'm going to choose what type of web application to make it. What am I going to put into that empty shell? So here I'm going to choose the API. This is something we could use to build a web API that would make the data available for other developers inside our organization or out, it doesn't matter. Just pick API there. And I'm going to uncheck to configure that for HTTPS because that's not part of this demonstration. Though probably, certainly something you want to do in real life when you build out a web API. All I need to do from here is to just hit create and this is going to create the shell of this project for me. Not even just the shell, what we end up getting is a service. So this is under controllers and in core, the way the web API manifests itself on the server side is it's this controller class. So it's going to give us back a weather forecast and we've actually got some code in there already and we can test doing a get. Now, I'm not going to get into a lot of the C-sharp code. You certainly don't have to either but this will allow us to do a get request from JavaScript. Now, there are a couple other things we need to do if we're going to use this project. And we're going to say add packages, say like jQuery, for example. And what we have to do is come into our startup file here. What I want to be able to do is serve static files that are in a variety of directories. So I'm going to come in here to my configure method. Use static files allows me to serve files that are in a three w root folder, and that naming is important because that's what the runtime is going to look for. So I'm just going to go ahead and add that in there even though there's not anything in it just quite yet. And this one, if you're using NPM, then we want to be able to use the packages that we install into the project using node package manager and this little bit of code is going to let that happen for us. And right here with the drop-downs, I'm just adding the namespaces that we need to make that happen. So you can just copy that verbatim. And then on the top of your file, you are going to make sure that you have all of those using statements that just brings the code into scope, so that we can use it here. That should pretty much work for our setup for right now. What we probably also want to do is add our NPM packages. So I'm going to come up here and I've got my neat little utility open command line installed, and I'm just going to go ahead- And I know I'm going to use J query here, So I'm going to install that. That adds a node modules folder here. I'm going to hit the show all files button on Solution Explorer, and I'm going to right click on the folder and say include in project. So now that's going to be available to use whatever other packages we end up with down there. So what we've got is this forecast controller, as I mentioned, and it's got a get on there and it's just going to return some randomly generated something that kind of looks like a weather forecast. So, let's see. Let's give ourselves a page and I'm going to serve this from within three w root. So it's nice and easy to go and get to and we'll add an HTML page. There we go. And we can just leave it called default, even. And what I need is my script link for the jQuery that I've got in the node modules. Add that in there and we'll just do a quick sort of hello world here with our document ready function. And again, you do have the ability to make Ajax calls and all the sorts of things that we're going to do, using regular JavaScript but probably going to want to use jQuery. So we'll put that in there. And what we need to do is we'll just show this here. This is going to be a jQuery, Ajax, get request. It's going to go to that location. So the question, as you're hooking this all up together is 'How do I know that that's the location that I want to go to?' I'm going to come in here to my project properties, you're going to go to the debug page here, and this tells me exactly where this app is. So it's local host port five- two- zero- six- one. So I'm going to want to go back and make sure that that is correct. And since our controller is named weather forecast controller, we can call that without the word controller on the end. So I'm going to make this get call. The data that comes back, I'm going to log it to the console. And I'm also going to just append it to a results section on the page. And we'll do this real quick and dirty, just so we can verify that we've got a service and that the service is working. So, let's give this one a try. I'm just going to do a view in browser on this thing. There we go. There's all our data. No big CSS there, we just wanted to prove that it worked. So you can pretty easily use visual studio to build out a web service, and we could use that for testing for all our Ajax calls and Async calls that we're probably going to want to do with any sort of web service. So thanks for watching. In our next lesson, we'll take a look at issuing basic Ajax requests, with regular Java script.