Now, I did actually switch the project here.
I went back to this Node.js Express project I started working on in the previous course
section, and it's this project where I now want to explore some other chat-related features
offered by Cursor.
For example, its Docs feature, which is really neat and convenient.
Let's say here in this application, in this Node application, I have a public folder that
contains some content, some images, whatever, that should be served publicly, statically,
you could say, which means if this web server here, this Node.js Express web server would
be up and running, requests to any files in the public folder should directly be forwarded
to these files and these files should be served back to the visitors without any other steps
involved.
Now to add this code, we could use a chat instruction, add code to serve files from
public folder statically, and it would probably work.
But to be sure, we can bring in some Docs and refer to the Express Docs, which is the
documentation of the Express.js library I'm using here.
And Cursor is aware of many Docs.
If you go to Docs, you'll see there are lots of Docs, well, it's not scrollable, but there
are lots of Docs here for React, for AWS stuff, for Django if you're doing Python development,
for all these popular libraries essential, for Node.js itself, everything's here.
But if something were not here, you could also add a new Doc and just copy in a link
to some documentation web page and the content of that page would be considered for future
responses.
That's an amazing feature.
Here I'll just use the Express documentation.
So I'll go to Docs and use the Express documentation.
And then hit generate to hopefully get some code that does the trick.
Yeah, so this wasn't too difficult.
It adds the right code here.
But this documentations feature where you can add extra resources to your chat prompts
as context for these prompts, that's a super amazing feature because that also ensures
that if you're using Cursor with some relatively new or lesser known package, you can bring
in that extra documentation knowledge and Cursor has a higher chance of generating good
code.
Because that's often the problem with AI models.
They're trained on old data, so if you're working with a new library, with a new package,
the model might not know it or not know it that well.
Well, you can bring in the extra documentation to solve that problem.
So that is an amazing feature offered by Cursor.