Get new issues of The GitHub Insider in your inbox. Sign up now →
The GitHub Insider
Your secret sauce to flavorful apps  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏
GitHub

How to build a controller function in Node.js with GitHub Copilot

Whether you’re a software architect, QA engineer, technical lead, or any other type of developer, you’ll most likely benefit from building a controller function in Node.js. A controller function is a specific piece of code within an application's architecture—often found in the Model-View-Controller (MVC) pattern—that facilitates communication between the user and the underlying application logic.

Think of the controller function as the master chef in your code kitchen. 🔥👨‍🍳 It takes in your ingredients (user input), works its culinary magic behind the scenes by interacting with the data model, and serves up a deliciously updated UI 🍽️. So, whether you're coding up a storm or cooking up code, the controller function is your secret sauce to a flavorful application.

And here’s a little extra food for thought: Did you know that you can build a controller on the fly with GitHub Copilot?

Follow this recipe to cook up your own controller function in Node.js with our new AI-pair programming tool:

One of our very own Developer Advocates, @LadyKerr, used this exact recipe to help concoct a GPT-3 application with GitHub Copilot that finds the nutritional content of any recipe with AI 🍜. You can find the source code and build it yourself here.

Or, if you’re a more visual learner, you can follow the steps in this video:

Ready to whip up a controller function of your own? Let’s get cookin’! 🍴

Sign into GitHub Copilot


Discover more AI magic at GitHub Universe ✨

Our one-of-a-kind developer event will feature an AI track where you can learn more GitHub Copilot tips and tricks, join interactive sessions, get certified, and connect with your peers. But hurry, our early-bird 20% off discount ends soon.

Get your ticket now

Subscribe to our LinkedIn newsletter 🚀

Do your best work on GitHub. Subscribe to our LinkedIn newsletter, Branching Out_.

Sign up now



Join our GitHub Copilot conversations 🤖

Visit our community forum to see what people are saying and offer your own two cents.

Visit now




GitHub

The world’s leading AI-powered developer platform.