Hello and howdy everyone, Welcome to another Adventures in Anguler. My name is
Alyssa Nichel, and today with us on the panel, we have Chris Ford,
Hello, from The Hate Death of the Universe. I here, it's
warm in the UK right now, just a touch. We also have with
us brook Sports It Hello, Hi, I'm like waving its mate great,
Greg Holdier, doesn't it? Yeah it does. I'm waving. I'm waving
back and gentlemen. Today with us our guest of honor, Man of the
Hour, Eli Lucas, Welcome to the show. Eli, Hi, everybody
from Hot and Smoky, Denver, Colorado. Smoky. Yeah, we got
we got a forest firing going on, so we've got a bunch of smog
and stuff in the air. I figured the first half of twenty twenty tried
to fatten us up, and now it's trying to smoke us. So that's
just what you want, isn't it. I have it. But the way
you described that, I was like kind of sound like beef jerky. So
it could be the weather, it could be a smoked meat, you know,
like, right, is Hannibal related to this? Brooks? What were
you saying? Oh? Well, people, I mean, oh, right,
you're smoking human meat. So Eli, tell us a bit about yourself,
who you are, where you work. Yeah, I'm a software developmer,
been doing this gig now for a little over twenty years, and I
work at a pretty awesome company called Ionic, which you might have heard of
before. Yeah, but you know today though I'm not I'm not here to
talk about Ionic. I'm here to talk about a little something else, tell
Us tell us Eli can be talking about on today's show. So today we're
going to dive into an SJS a little bit. And before I actually start
talking about SGS, IONE want to give a little story about like how I
ran into it and where I find it's very about valuable and so if you
think about it, we got this like Unicorn and title out there and software
development called the full stack developer, right, And to me it's like,
well, what what does like full stacked development mean? And it's kind of
like where you're pretty confident on being able to work on both the front end
and of the application and the back of the application. And before like front
end web development really exploded, this this was like something that people commonly did
on like the website and the back ends and whatnot. And like, really,
when you said back in developer, you probably talked about people who like
did more database stuff than just like server side stuff. And now that role
is kind of like morphed into like, Okay, we have our backend developers
that work on like the APIs and all the back end things, and the
front and developers which are coming to the client side. That's because like both
of those sides of the equation have got a lot more complex over the years.
And that's because we're dealing with oftentimes like different programming languages, different platforms,
different sometimes even different operating systems that they use and whatnot. And I
was on a team about three years ago before I joined Ionic, and we
were kind of in that situation. We had like four or five fern and
devs that were working on like an angler JS Ionic application and one Java dev
that was working on the back end, and the front end team was just
like really outpacing what the person could keep up with on the back end.
And so we got together as a team was like, well, what are
some of the things that we could do to solve this problem? And we're
kind of like, well, the front and devs could go and they could
learn Java and you know, get with the tools and stuff to do the
Java development. But we also thought, like, well, what is if
we just use like node on the back end to do our development because everybody
on the front end already knows javascripts. We already had no tooling, and
already the Java developer like hung his head and walks away slowly. Actually,
actually he was pretty cool. He got behind it. I was going to
say, how do we speed up our back end development fire the Java developments?
Oh my god. But yeah, so that's kind of what we did.
And we moved when we moved around to like slowly like writing all of
our new stuff and Node with JavaScript, and it was working out pretty good.
But we had this microservice architecture, and what we found was that whenever
like a developer started up a new micro service, like we didn't have like
a whole lot of like guidelines to go by. We were using just like
plan Express on the back end. And one of the things about Express,
while it's like super easy to get up and running and get rolling with it,
Express doesn't offer like any type of real guidance on how to architecture applications.
And so we go any further could you for people who are have never
I have heard of micro services, but I've never used them myself in development.
So can you give a quick example of what a couple of micro services
were and how you used Express with those. Yeah, And to say like
our stuff was like microservices is probably a little bit of a misnomer. Why
we tried to break break it up. It wasn't like super super micro services,
but like we had like an authentication service to deal with authentication, and
we had a user service that dealt with the actual users of our application,
and then different areas around each major functionality piece of our system we had a
service for and so this like we had a chat service, and we had
a notification service and a weather service and stuff like that. So each service
you're saying there, there weren't very many like rules around how to write them,
so it was just kind of chaos between the services, right, Yeah,
And that that's kind of what we found. And at the time Angler
just popped on the scene, and with Angular came typescript and I started really
getting into the typeescript and I was taking a look at all of our different
services and I was like, well, it would be kind of cool if
like we could use some mechanisms from typescript to help like ease up on the
amount of code that we had to write. And I came from a background
of like ASP dot net development and a little bit of job of Spring development,
and so I was kind of like used to like the frameworks providing like
these this type of guidance how to do things. And one of the things
I really liked about ESP dot net development is like how you define your routes
and stuff. And so I was like, Okay, we got in typescript,
who got decorators? I would really like to use a decorator to define
how my routes are going to work instead of Express application. And so I
started looking for how to use Typescript with Express and that's actually how I found
Nest And so a little bit of background on nests. So this is about
around when Ness was just coming on the scene. I think it was like
virsion of one point zero. But Nest was a back end framework that was
meant to provide an opinionated way to develop back in applications. And the way
that they accomplished this is that they took a look at like what was going
on in the angular world, and Angular was an opinionated way to develop front
end applications, and so the creators of Nest really got influenced by how Angler
was created and tried to reuse a lot of the Your Pepper is adorable.
I love her, and she's very welcome on this podcast. She wants to
be a part of the conversation. I'm just honestly surprised that you were all
for not doing Java, getting on the NOE train, getting on the express
train, and then discovering nests when you had a background in ASP dot net
like and you were ready for more structure, and yet you dove into the
JavaScript world. So it seems very Yeah, I was the only one on
the team that came from a background. Everybody else was, well, most
of everybody else was front in developers, and then the entire company was pretty
much JVM Java based, and it was a little bit of a negotiation with
like our CTO and stuff to start using Node, but he kind of understood
the value as well as like, Okay, you got a bunch of jobscript
developers, we should get them right in jobscript on the back end as well.
But pretty much the entire rest of the company was all JVM based,
and so when you discovered Nest, it was like this breadth of fresh air
to bring that structure to the back end of this application, right yeah,
because Ness just offered what I like to call building blocks us to structure your
application that you could use. So, especially if like you were an Angular
developer coming to the back end, Nest uses a lot of the same concepts
and nomenclature and whatnot that Angular apps do. And so if you see something
like a pipe or an interceptor or a guard, it's like, okay,
I know as an Angular developer where that logic is going to go. And
what I find a little bit funny about it is that, you know,
the Angler team was a bunch of Java developers originally, I believe, and
so when they went to go right Angler, they took a lot of the
concepts and stuff that they knew from developing back in applications into the front end.
And so then I kind of went like in this big three sixty very
cool. I've used nests before and I kind of had a similar experience while
I started with Firebase and got frustrated with that and then said I'm just going
to write an express app. And then my Express app was Spaghetti and then
I found Nests. It made it all pretty again. Okay, yeah,
exactly made everything work now, but yeah, it's mostly done for an end
work for the past like six So it was like my first time getting into
the back end and it was very easy to jump right into Nest yep.
And were you an Angular developer before? Yeah? Yeah, yeah, so
that's what I hear, Like Angular developers are able to jump into Nest like
super easily just because of how close architectures are. But I also like to
say that, like net, Nest is a platform for building back end applications,
and it doesn't it doesn't matter what your front end is. It doesn't
have to be Angular like. Ness is just as beneficial to like React developers
or View developers or native mobile developers, or if you're building like just the
system of back ends in general, that ness is a great platform for all
those things. Yeah, definitely potentially dumb question. So if you're using Angular
for sure, and you have a note back end and you want to use
Nest, does that mean you are also for sure using Express or not necessarily
so, Nest by default encapsulates Express, so it uses Express in the behind
the scenes for you as it's HTTP engine. So while a lot of the
concepts are somewhere with the Express and you can actually get access to the Express
pieces if you need to. The develop actually saw something about that in the
Nest JS docs, so I was like linked, okay, yeah, but
the development experience is like way different from developing an Express application and a Nest
application. Nest application is more like developing like in another type of NBC framework,
and so you have these like clear separations of concerns between like your controllers
and your services, your views, which if you're writing like an API,
you can probably consider like the view like the JSON or the model of the
Jason that could returned back to the client, or if you're using Nests to
do some type of server side generated HTML, the HTML would be like your
view for the particular aspect. There's also a great like community around it with
the plugins and stuff. Have you used any of those or a little bit.
So the back end I typically use to attach to a Nest application is
like postgrads, and so the data layer that I use mostly is typeo ORM
and if you like everything that's Nest is doing, type or M is architected
in a very similar way. There's lots of uses of decorators to define your
types and your relationships between entities and so type or M if you're coming from
a dot net background, type of ORM is like very similar to Energy framework,
and so you can use it to it's a code first database approach.
You can use it to generate your database and run updates to your database as
you do like deployments and whatnot. It's pretty cool. Some of the other
plugins I haven't gotten too much into, but I know there's like a Swagger
integration. And then you can also use nests to do stuff that's not just
like straight up HTTP. Slash rest APIs like you could do graph you well
with nests. You can do web sockets in real time communication with nests as
well. And so those are some additional plugins out there, Brooks, Are
there are do you in compass the plugins that you've used before? Are there
others that I must want to enough to use the guel one? I haven't
used it yet, That's what I was curious. Yeah, looked at them
longingly a couple of times and have an excuse to start to play with it,
right Yeah, Yeah, graph Fuel is one of those things that has
definitely intrigued me over the past few years. Especially Sin's gotten more popular,
especially in the in the reacting world, and when out dive into it,
I'm planning on utilizing Nest to do so. I just quite back up a
little bit when you were saying about how Nest basically like encapsulates express. Is
it the like you know with if you've got like a vanilla JavaScript application,
you can you can migrate the type script literally by just renaming your files from
dot jas to dot t s and just make sure you compile them. Can
you do the same? Can you? If I have an existing Express app,
can I just like load Nest into it and be like, technically,
now I'm using Nest and then i can start building Nest bits on top of
what I've got. Technically you probably could, because when you go into the
main startup file for Nest, the main dot ts file, what you do
is you boot up a version of the application for Nest, and that application
comes from an interface called like I don't remember the exact name of it,
but it's like I Nest Express application or something like that, and so that
application object has the same interface that an Express application has and so if like
you were wanting to like cook up like any Nest middleware, any existing like
a sorry that Nest middleware Express middleware, it's completely compatible and that's where you
do it. And so I would assume that, like, if you have
existing route handlers and stuff that you want to use that are Express route handlers,
you could register them the exact same way there, and then for like
anything additional, you just like let the Nest portion of the application take control.
So it's something I haven't tried, but from what I know everything about
it, it's probably possible why our sisters so integrated if anyone from the same
team worked on it, or do you guys know who created it? Yeah,
so it was created by Camille, and I would Butcher his last name
if I speck too if I tried to say it. So I'm not going
to but include a link down there. And so Camille runs a company called
a Trillion I think is what it's called. And so it's kind of they
do a bunch of consulting and education around Nest applications and just kind of application
development in general. But yeah, it's an open source project. It's I
believe in it license free, free to use, so you can get started
with it. But you know, just kind of a small team. But
it's been just exploding in the past couple of years in popularity. I think
it's the fastest growing HTTP library on the note ecosystem for probably a couple of
years in a row. Now it's not monetized in any way. Is it
just purely based on like sponsors and I say, they've got like a sponsor
ust link on the website on the dogs. Yeah, yeah, they just
started selling course. Yeah, I think that just came today is a Wednesday.
I think that just came out a couple days ago. Actually, oh
wow, yeah, yeah, coming from I converted the app, the cruse
I from Express to nests and it was mostly I mean I probably could have
still used the express app and then done ness things to it, but it
was pretty easy just to take my routes and copy and paste and like neestify
them or whatever, put them in the right you know type script. So
take like your handlers and put them into controllers and whatnot. Yeah, yeah,
yeah, it's probably yeah, probably a fairly easy easy upgrade. So
as a completely front end of the front end person asking this question right under
the front end. Yeah, like what's the front end of the front end?
Literally you're just you're just the one using it's a monitor. Like when
I say I'm a front end, webe I mean it. I don't touch
the notes, That's what I mean. Like, I'm like, hey,
I can totally make Like for instance, in my last job, I was
tasked with building a gradient color picker from scratch, like in matching out it
was awesome, it was well, and then matching those colors and making them
as true to form with the print colors because I worked for a print company
and so I've freaking had a blast. I love building custom components and CSS
is my jam and that's where I live. So whenever I talk about things
like this, it's a little intimidating. And so Brooks, you're talking about,
Okay, I'm converting this express app to testify it. Do you find
it's a bunch? Did you or Eli find it was a bunch of overhead
to like all this extra syntax, all these extra files, all of this
ex Like, yes, it's more structure, but in my mind, it's
also like all this extra stuff you have to do to get the same functionality
so can you talk about to that for a sec? Now? I like
that because I had lived through my spaghetti code for about a month ahead of
time, right, so I had banged my head against the keyboard enough where
my head's still hurt. So it was a relief to have all this structure.
I don't know, you lives, yeah, and for me like probably
like really depends on the situation, but like most of the time, like
I'll give this situation. I just popped up a couple of days ago where
I was going to go write a Lambda function on a WS and I wanted
to like prototype it and stuff locally before I actually started to put it put
it into Lambda. And I happily started up a Nest application and started to
prototype it up up there. And then what I ended up doing was basically,
once I got done, it was a super simple method to like switch
out like headers on HP requests and stuff like that. And so once I
got it done, like I just took the job ascript out of the Nest
application and copied it into aws's Lambda's editor and got it up and running there.
But what I why did that as opposed to like trying to fire up
a Express application is that the Nest CLI makes it so easy to like fire
up a new app and to get stuff like debugging. And you know Angular
Cli for granted, So you're saying to do that stuff an express it's by
hand. There's no Express cli. I imagine somebody's probably written one out there.
I'm not I'm not aware of any, and I don't think there's any
like de facto standard that people flock to for generating express apps. But yeah,
the next CLI is is very similar to the Angular Cli. I think
it's based off the same code base, and they use like Angular schematics and
whatnot so that you can easily generate like new controllers and modules and all the
different various pieces that you can for a next application. But yeah, it
was just so easy to get them running. Like I was like, I'm
not even going to try to like fire up a Nest application and whatnot on
my own, Like I could have, but I would have just taken longer.
Okay, So because of the CLI and also your like love and need
for structure, it's not a hassle or it's not tedious to do things in
Nest. Great. I think the CLIs are great for that because I do
the same thing. If I want to just test something out in an angular
thing. I know, allow your technically good like stack blitz. But if
I'm not going to stack blitz, of the fact that I can just drop
a fresh anger application, you know, on my desktop with the cl I
just with a simple command, you know, and all ten million node modules
that comes with it. I have so many test apps. I actually recently
just went through and cleaned it up. It was very cathartic. I recommend
it. I was going to say I changed jobs when my father test apps.
You know. Yeah, sorry, I have to now there's too much
your I don't really know anymore. There's nothing I can do. I'm not
interesting about the what you were saying about the serverist stuff. Is there any
do any of the servilest function places have support for nest because I know that
you can like write. I mean, I don't do serverals stuff. I'll
be honest. There's something I've been interested in, but I've never been brave
enough. I know, like with Microsoft, I never now to pronounce this
Azure right, yes, over here, that's that word is pronounced asure,
so I never know what to call it. So with the Azure functions,
I'm fairly confident in saying that you can. You can write them in node,
right, So is there Nest support for that if you wanted to.
Yes, there is, And I am quickly almost as if i'd planned that,
Quiff, I didn't. There is a fan, and I want to
find the name of it so I can actually talk about it here. I
feel so bad, Chris, because I have a heated blanket on my lap
right now. But you can see, you can see how I'm just dying
here. Yeah, so sorry, darling, I've actually I have actually opened
my window now tell me if the traffic noise gets too bad. I haven't
heard actually anything, so it's good open them all. What have only got
two don't go very far either. So we were asking if there's a way
to use Azure with Nest in Yeah, and probably like Servilus in general.
So I know, I know there was a team of the Azure de'v advocates
out there, probably six to nine ago, put together a small project to
make it super simple. I pushing Nest applications up to as your functions,
and I know there's a similar project that you can use to do it tows
Lambda as well, and I played I have played around with the lambda one
before, and I wanted you to get into the your one and check it
out. Yeah, I'm looking at this post right now. It's nest ad
nest js slash azure function h GDP. Yeah. So it looks like yeah,
yeah, and so basically what it's kind of like a little piece of
metalware library that will because generally functions are agnostic to what type of trigger triggers
them, if it's like an HTTP trigger or or something like that. And
so what the libraries do is they listen for their trigger request to come in
and then see if it's an HTTP trigger, they kind of reconstitute all the
objects, the request objects and the context and all that kind of stuff,
and so when it actually gets to your nest application, it feels like it
actually came in from an HTP request instead of a trigger. And so like
you can do it surrouting with the u r L and get access to the
headers and all that fun stuff. I thought I had a cool name,
but I'm looking at the blood Puss now and it kind of looks like it's
just called as. You're we can make one up, Yeah, just name
it now and then nest as your coolness. I'm a Missouri developer, yeah,
specialized miss certification. Yeah, so your experience. I've written a load
of Azure functions in next specifically. Yeah. So, so sometimes it might
be a little bit of overkill to do something like a servilest function and nest.
But if you're planning on you know, probably taking a little bit too
much of an advantage of a servilest platform and trying to put like a whole
application into a servilist function like something like nests will probably make a bit more
sense. I'm pretty sure there's people out there who would tell you that is
exactly how you should be building your back end of your applications, right,
Yeah, I mean I don't I don't think that that's what it was meant
for. But when you think about like the terms of scalability and low cost
and whatnot a service infrastructure gives you, it makes a lot of sense to
do so, all right, And so with that, I maybe you can
talk a little bit about like some of the things that NEST does. When
I talk about like the guidance that it gives you I want to do and
how like it's influenced by Angular. Yeah, the building blocks as you call
the building blocks, and so it kind of starts off with modules. And
as Angular devs, you're pretty familiar with modules and the Nest application modules look
very similar and they kind of provide the same concept and capability that modules do
in the Angular role and being able to break down your application into smaller pieces
and then combine them back together into a larger application. Now, I'll kind
of be honest, like in my nestwork, like I don't think i've ever
like actually separated out a module. And if the COLI didn't do it for
me in Angular, I probably like i've done it in Angular either, so
offensive all things. Yeah, well the module per file, that's me.
Yeah, well the CLI does it for me now, so I don't have
to I don't have to worry about making anywhere. Right though, I do
feel very at home looking at these docks because, like, for instance,
you're talking about modules and it says import module from ne STGs slash common.
It's very it's a very Angular esque all of it. It looks just like
Angler, doesn't it. Like literally, the only thing that lets me know
I'm not looking at Angular code in the docks here is that it's just at
module and not at energy module. It's literally the only difference, right,
And so then with that, and you also have your services and providers,
and so in a typical back in NVC style architecture, your services and providers
are kind of what's responsible for like communicating with the data base, some type
of third party storage system, other APIs, other back end services and whatnot,
and so that's their responsibility. And then you have controllers. And we
don't have controllers in Angular anymore, but we did in anglar js because when
angler js first launched, they called it like the MVV star framework or or
something like that, but it was kind of like like you lived to earlier
that Angular JS was kind of modeled after your back in development, so it
was kind of like an MVC framework but on the front end, and controllers
and an NBC application are what's responsible for communicating with your client and relaying those
messages back to your services and then responding to the client with the output of
the services. And so got the controllers that do that, and the controllers
and web API are what listened to the HTPU request coming in. And so
a controller in Nest is pretty simple to set up. It's just the basic
ESX class that has a controller attribute attached to it. The controller attribute takes
in a string which defines the route that it's going to listen for. And
so let's say you have like a people API, and so the controller attribute
would taken forward slash people, and that lets NEST know that this controller is
going to listen to all those requests that come into forward slash people. And
inside of the controller, you're going to have methods. And if you want
to have your controller listen to a particular HTTP verb that comes in, you
would decorate that method with that particular attribute. And so you have like a
get attribute to respond to get requests, and they put a tribute to respond
to put requests and post and de lead and so on and so on,
and so you put those attributes on those individual methods. And so if you
have like a get list or get people to return back a list of people,
you put a good attribute on that. And then if you have like
another get request that's only going to return back an individual inside of that get
it. I keep calling them attributes, but I also mean like decorators because
I come from dot net world originally. But you have the get decorator,
and you can specify dynamic parameters instead of that get decorator as well, and
so you can specify an ID. So if somebody goes to forward slash people
slash one, the GIT decorator that has the dynamic parameter attached to it knows
that this is the method that's going to respond to that to return back a
individual person. So can we back up a step and look at what we've
just So we've covered modules and controllers so far, and basically you have this
module which is going to point the way at like in their docks they have
like cats controller and CAT service. So it's like pointing out both of these
pieces. So for every is it true to say, like for every controller
that I need, I have a module? Is that the Yeah, that's
not so you could put them all on one module and just like keep yep,
you could put them on one module. And by default, I believe
that's what the SCLI does for you. So if you use then SCLI de
generated controller, it's going to update the app module okay, unless it unless
it's a little bit more smarter and if like you have a module already in
that folder or something that might update that module, but by default it's going
to update the module. I was going to say, like with with the
ANGLICI, it actually just looks for the nearest module, doesn't it to where
you're putting your suit? Yeah? Yeah. So if you have, like
if you have two modules in the same folder, like if you have like
your material module and you're apt module, obviously is a good place to put
them. If you do, just like n GGC my new component, it
will actually flag up and say you need to specify which module you want to
put it in because there's two in the two are the closest ones. So
if you then had a like a subfolder, like you know, cheese,
and you had a cheese module in there, Yeah, yeah, I'm going
with this. If you have the cheese and then you do like n GGC
cheese slash and crackers component, then it will actually import your crackers component into
your cheese module because it's the nearest local module to the component. I love
it. So what Eli was saying is by default, when you just I'm
going to I'm going to use nests today and you use it, and it's
going to use your app module. It's not going to create its own module.
Dot ts file for all the bits to be configured in correction Mark okay,
and then controllers. As you were saying, there were sounds like all
of your methods for like you know, get and find all and all these
things are defined. But then I feel like we're missing Are we missing a
piece? If we're missing a piece, and so inside of our controller,
if we're if we're calling, if we want to return back a list of
people, like where where do we get that data? Right? And so
that's where the services and providers slash providers come in. And so just like
an angler, we inject our services via the constructor into our controller and now
we have access to that service. And all that wiring up of the dependency
injection system is done in the module, very similar to how it's done in
Angular. You have your provider section and you just listed the provider section.
That way it knows about it real. They don't like I feel like the
word provider and service are interchangeable. Is that true? Yeah? I would
say like all services or providers and providers can be other things as well doing
it. Yeah, if you think think about it, right, you This
is not me talking from actually knowing. This is my assumption like in your
angler app, right, your services go in your provider's array, right in
your module that you have to provide your service. So oh, I thought
you just put them in one of those arrays until it work. That's how
much Brooks. I know you're probably being facetious, but like, well that's
how you start. At least people really do that again, but my services
are all in my entry components. Why is it not working? So one
of the cool things that Nessa does that you would normally have to wire up
yourself in an express application is that in order to get like an HTTP request
that returns back like a bit adjacent an express application, there's various pieces of
like middleware and stuff that you have to like hook up, like you have
to like hook up like a. I think it's a middlewhere called body parser.
Like if you're ticking in, like if you say yeah, Jason requests
and stuff like that, Nest handles all that stuff for you. And so
if you're doing a like a post request, then your body has a bit
of JSON and the content type is application slash Jason. Nest is automatically going
to take that Jason and inject it into a parameter in one of your controller
methods. And so if like you're accepting a person in a post request,
all you need inside of your controller is like a create person method that takes
in a person object and this will automatically map that Jason response into that personal
object for you. That's aluesome. Yeah, So, like, no need
to do no need to start yourself off with learning express is what you're you're
saying, Just go straight to Nest, like you never never learn express?
Is I think the key Wait it sounds like it. I I'm really I
know, we're almost to the top of the hour. We've got probably ten
more minutes to dive into any more of the building blocks. But I feel
like I've got a really good handle on at least the basics. Are Are
there any other like this one? Like? Yeah, yeah, so there's
other pieces of So now we're getting into specialized pieces of middleware. And in
an express application, middleware can sits in between the client and the back end
of the system the response, and you can do various things. Nest has
middleware as well, but they're very specialized in what you do. And as
Anger developers, when you hear the names of these you're going to be kind
of familiar with what they do, and so we have pipes, and so
pipes and nests are kind of the same purpose. There's often used to convert
various pieces of data as they're coming into your system into a particular format,
where like a pipe and angler is used to like convert something for display purposes,
and so pipes are often used to convert data. So like if you
have a string, but you want it to be a number or something like
that, or a particular object that needs to be morphed a little bit before
it actually hits your controller. You can also use pipes for validation, and
so pipe is a good place for you to be able to look at the
request coming in and validate the input before you actually say to your control.
And then you have interceptors, and interceptors listen to both ends of the requests,
and so I can listen to the beginning of it, take a look
at the data, and then pass it, pass it through the rest of
the pipeline, let it go through your control, and then it gets access
to the data again at the end, where you're now free to modify that
data as it goes out. And so like what you can do there is
like if you have a specific schema that you like your your responses to adhere
to, like that now's your time to like put the data into a data
field and the metadata into a metadata field and whatnot. And then you also
have guards, and guards are very similar to angular guards that kind of like
provide authentication for your app. And so a guard can intercept the request as
that's coming in and you can do all your authentication checks on it to make
sure that the users allowed to access this resource and pretty much like return too
to them through or return falls to give them a forbidden request status go back.
But what a like about these is kind of the express world alls you
the only building block that you have is a piece of middleware and you kind
of have to figure out how it's going to fit into it all, where
these are like very specialized and so like when you think like okay, I'm
doing authentication, I know to put that into a guard. Or if you're
a developer who knows Nest but you're going to another Nest application, you kind
of know that like, Okay, if I'm going to look at authentication code
code, I'm going to the authentication guard for that versus like you know,
half an asked somebody like, hey, where's the authentication code for the appen
in this and whatnot. It's just that, you know, pretty opinionated guidance
that an enterprise grade framework like Nest gives you that something like Express doesn't you
have one sold me on SJS today. So to back up just real quick,
I saw that when you're talking about pipes, there is like six different
built in pipes with Nests like validation pipe, parcent pipe. Do you know
if there's a way to build custom pipes? Yeah? Yeah, So all
these you're you're able to build custom versions of them, and the built in
ones are like scenarios that the Nest team knew were going to happen so often
they just included them out of the box, especially like validation and then like
the parcent pipes, because it's very common for you to take in like a
parameter from a dynamic parameter from like a URL and inject it into your controller.
But anything that comes from the URL is going to be a string where
a lot of times if you're using integers or numbers for your IDs, that's
going to come into a string and you normally have to convert that yourself into
a number before you pass it into your back end. The parsit and pipe
just automatically says, like when you decorate a parameter in your controller method with
Parson, it's going to be like, okay, if it's going to be
a string, come again, automatically convert it to an energer, and then
when it arrives into your controller, it's going to be an integer. What
happens out of interest if you try to navigate to like slash cats slash b,
Like, what would your pass pipe do if you actually passed it a
letter? Would it just like four or four? It would probably give you.
I think that would be a four hundred bad request exception to let you
know that you probably did something. I'm not exactly sure that's what would happen,
but that's what I would I would want it to happen. There's always
one, isn't it trying to think of these? Yeah, because scenarios,
because the bad request is to say like, hey, you, as a
caller of the API, did something wrong? True, blame the user?
Yeah, exactly, I agree? Always is all I ever do? Well?
Actually, is this exactly what the docs say? Because it says that
it would throw. Nest will throw an exception like this validation failed numeric string
is expected status code four hundred. Yeah, we've definitely established out of the
vice who knows their status codes because it's not this guy. Oh my goodness.
So yeah, I am very impressed that. Honestly, Eli, I
don't know, like how you know so much. I feel like you have
a secret in with the Nest team because your your knowledge is very you know,
honestly, it all comes from the docks. Their docks are amazing and
you can go through and read those and whatnot. But besides that, like,
I've just been a huge fandom Nest ever since it's a released, and
I've done you know, toxic user groups about it and whatnot, and I'm
putting together a course for it. Nice. Yeah, I talked to ANNGI
confluence on it. So is that Do you think your course will be ready
when this episode drops? I hope. So I've been working on for quite
a while now. Where can people find it? What platform is it on?
It's going to be on Thinkster, So yeah, I've been working on
that for a while. So hopefully by the time this podcast airs that it
will be up and ready to go and if you're interested in learning some Nest,
go over to thinkster. And also I'd like to promote the Nest team's
official course as well, because the more learning there is out there, the
better it is for the community. Awesome, That's wonderful. So yeah,
check out Eli Lucas's Thankster course. I think it's thinkster dot io on n
s JS. And before we get to any more of Eli's picks or actually
picks in general, is there anything else about Nest or Express or anything else
you want to add on before we get to picks. No, nothing at
the top of my mind. Just like it's it's a framework, and what
I would say is like it's it kind of brings back some of the joy
of, like you know, developing back in applications again that kind of missed
for a while, especially coming from the sp dot NBC world. And so
it's like you're if you're used to like enterprise type systems that you'd find in
other frameworks, give it a try. If you're an Angler developer, give
it a try. If you're not an Angular developer, It's still a great
platform for building back in applications on notes, so give it a try.
As well all right, well panelists Brooks or Chris, do every one of
you have some picks to go over to it? I have one pick.
It's unlike me. I actually have a whole bunch of them. But I'm
only going to pick one thing, and them too. I need to move
out this room. I'm going to pick a TV show called What We Do
in the Shadows. Just finished watching the second season a bit. I think
it's might enjoy collabor between BBC and FX, so in the UK it's on
BBC. I have no concept of how you would possibly watch it in the
States, but it's like a mockumentary kind of in the vein of the office,
where you've got a TV crew following, But it's following these four vampires
who live together in Staten Island, and they're completely in One of them isn't
even a proper vampire. He's just like he's what he calls an energy vampire,
which basically just means he just bores people and then like feeds off of
their life force and so they just are passing out from sheer boredom. Is
absolutely hilarious. It's very very wittily written, and I would you can watch
it FX on Hulu is what this is saying in the States. So excellent.
I mean I would, I would. If you like witty comedy,
I would absolutely recommend it. It's very very like Chris, You're like,
you know, if you're at all cool person, Yeah, watch it like
it's it's so well written. I can't even I mean, the concept of
it is is insane, but it's very well done and I would recommend it
me. Yes, second, yeah, I go a second. Yes.
My my pick is neural Cam and it turns your smartphone into a webcam.
And I was playing with it before. I was going to use it on
this, but it didn't it didn't happen. I'll put it in the chat
and yeah, you know, makes you look better in general. And also
if you pick your nose while it's on, it'll blur your face out,
so that's good if you're in sticking your nose. I think it also blurs
out nudity as well, so if you accidentally get naked, it'll blur you
out. Happened on the zoom calls all the time. There goes the sure,
yeah, everything happens. It's just beltcrow down the side, that's right.
Sometimes you gets snagged on my chair something, and I like get up
to go, you know, close the door, and I'm just butt naked.
Yah. Imagine you and like one of those tracksuits that you just like
rip off with the velcrow. Yeah, exactly. Neural Cam okay, cool,
Yeah, it was cool. I was playing with it. Check it
out. I've played around with epopcam, which is kind of kind of similar,
except it doesn't have some of those cool blurring effect features. But I
had the same problem with him, like it didn't work with him, but
like I could use it and other applications. That is kind of word.
My pick is super Quick. It is on twitch code it Live. I
streamed there very often with my cohorts. But every Wednesday afternoon from two to
four I do a UI show where we tackle complex CSS problems. So yeah,
come join me. That's two to four Central. I'm really bad at
converting, so I'm not even going to try. So there you go.
But Eli, other than your thanks to your course, which everyone should go
check out, do you have any picks for it? I mean, I'll
pick a TV show too, And it's not exactly new, but I'm just
starting to get into it and which is kind of late for me because I've
been a treky all my life. But I recently started watching Star Trek Discovery
after I watched a Star Trek with Card and I'm really enjoying it. It's
it's kind of hard to call it Star Trek because it's so different, but
yeah, it's really good. It's a little bit a little bit darker and
more mature than Star Trek that you might be used to, but liking it.
And next thing I'd like to throw out there is at Ionic we just
recently got done doing our Ionic comp which was a virtual conference celebrating web development
and technology and hybrid mobile development and all that fun stuff. And we just
put up all of our sessions on YouTube, and so if you go to
YouTube dot com slash Ionic Framework, you can view all of our sessions for
Ionic Comp. I actually I watched some of it live. I watched the
WebVR one. Yeah that one. Well, Eli, thank you so much
for coming on the show and teaching us all about the wonders of Nest and
man, you are a wonderful, wonderful guest to have on, so seriously,
thank you for taking time to join us. Yes, thank you.
I had a great time all right, well, that is a wrap.
We'll see you next time.