From the course: Create Your Own Code Assistant with Llama 2, Node.js, and React.js

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Setting up the Llama's pen

Setting up the Llama's pen

- [Instructor] In our Codespace, still in our backend directory, we are going to create a new service for our custom configuration. To do that, we're going to run the command nest g service and we're going to give it the name and custom-config. Hit enter and wait for that to complete. Let's clear the screen and take a look at what we've done. In our explorer, in our source folder, we now have a custom-config directory and we've automatically updated our app module to have the custom-config service. So let's look at what it's given us. We've got this new CustomConfig class. Let's add some code to it. We're going to completely replace this injectable with a regular export. We're going to import cosmicconfig. Then we're going to load our configuration from a file we defined. I called mine kuzco. Then we're going to search for path to find that file. If we can find that file, we'll log out the results. If there are results, we'll return the configuration. If not, we'll return a default…

Contents