I am back over inside my packages directory.
There's our local API package right there, so we're going to use the Lernout command to install Xpress
and a type definition package or express into our local API project.
We are also going to install one or two other modules along the way and we'll talk about what these
additional ones are in due time.
Now, remember, we are using Lernout to do all these NPM installs.
We are not running and install directly.
The one downside to using Lernout for managing all of our packages is that we can only add one package
at a time.
So we're gonna have to run, learn to add a couple of times in this video.
So let's get to it because it will take a little bit of time.
Well, first, begin with a llena ad xpress.
I'm going to set the scope.
So we only want to install Xpress into our local API package.
We're going to run that.
And in just a moment or two, it should be installed very good.
Next up, we will do a llena ad at Type's Express.
I want to say this as a development dependancy.
And then the scope will be local API.
Just two more very quickly, we're going to do a llena ad course.
SCOP, once again will be at local AP.
Learn to add at types, of course.
Again, we will see if that as a development dependency with dash, dash, dev, scope of local API.
And then here's for real this time, though, the actual last one we need will be learn to add HTP proxy
middleware.
And again, a scope of local dash API.
OK, so that should be at.
What we've now added in a couple of different packages, we haven't really discussed what the course
package is for or what proxy middleware are for either, but don't worry.
Again, we'll discuss what this is all about in due time.
Right now, let's go back over to our code editor.
We're going to start to set up Express inside of our local API package.
So back over at my editor, I'm going to find the local API package, here's the folder I'm inside of
index.
Yes.
So we've got our search function inside of here, the inside of this function.
I'm going to remove all the control logs we currently have.
And inside of this function, we're going to do all the initial set up for our express server.
So in this case, at the very top.
I'm going to import.
Express from Express.
Inside of the serve function, I will create my express app.
We won't associate any roots with this just yet.
Let's just go ahead and have it start listening on the port that is provided to our search function.
So that would normally be an app.
Listen on the given reports and then, of course, we might also want to have a little color back inside
of your and do something like that, log listening on words and then just print out.
The port right after.
Now, the code that we have right here is going to work just fine, let's try to run it at our terminal
very quickly.
But I want you to be aware that we're going to run into one or two kind of interesting things when we
start thinking about air handling around our Seelie.
So, again, for right now, let's just go back over to our terminal, just run this and make sure everything
works as expected.
So back over at my terminal to start up our local API, we have to use our Seelie that we put together.
So we're going to change back into our Seelie package.
We will change into that dist directory because remember, that is currently how we are going to run
our Seelie.
We're going to execute that node or joining that index, not just file.
So I'll do a node index dogs serve.
And we should see listening on PT. four thousand five here.
OK, well, it looks pretty reasonable right now, but like I said, we're going to very quickly run
into some interesting issues around air handling.
Let's take a pause right here and come back in just a moment.