<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kyrell Dixon</title>
    <description>The latest articles on Forem by Kyrell Dixon (@kyrelldixon).</description>
    <link>https://forem.com/kyrelldixon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F208504%2F922257a6-f17a-422b-aa34-d7e15bcf665e.jpeg</url>
      <title>Forem: Kyrell Dixon</title>
      <link>https://forem.com/kyrelldixon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kyrelldixon"/>
    <language>en</language>
    <item>
      <title>Creating a Next.js app from a Dribbble design</title>
      <dc:creator>Kyrell Dixon</dc:creator>
      <pubDate>Sun, 22 Mar 2020 04:14:21 +0000</pubDate>
      <link>https://forem.com/kyrelldixon/creating-a-next-js-app-from-a-dribbble-design-783</link>
      <guid>https://forem.com/kyrelldixon/creating-a-next-js-app-from-a-dribbble-design-783</guid>
      <description>&lt;p&gt;Recently, I realized that as a freelance developer and entrepreneur, it is really important to have at least some basic design skills. After reading &lt;a href="https://learnui.design/blog/5-practical-exercises-learn-ui-design-free.html"&gt;this excellent article&lt;/a&gt; about improving your design skills, I was inspired to follow exercise 2 and do some &lt;strong&gt;copywork&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That led me to a &lt;a href="https://dribbble.com/erikdkennedy/collections/310034-Copywork"&gt;Dribbble&lt;/a&gt; (yes, with 3 b’s) bucket containing a collection of inspiring designs to copy. I chose to recreate &lt;a href="https://dribbble.com/shots/3244008-Lonely-Planet-HP-Destination-Selector"&gt;this design&lt;/a&gt; by &lt;a href="https://dribbble.com/claudioguglieri"&gt;Claudio Guglieri&lt;/a&gt; and convert it into working code using my go-to frontend stack of Next.js and Tailwind CSS.&lt;/p&gt;

&lt;p&gt;This is a quick post describing some of my development decisions and where I plan to go from here.&lt;/p&gt;

&lt;p&gt;Before we get into it, &lt;a href="https://lonely-planet.now.sh/"&gt;this&lt;/a&gt; is the link to the web app and &lt;a href="https://github.com/kyrelldixon/lonely-planet"&gt;this&lt;/a&gt; is a link to the Github repo if you want to see the code. The code is pretty clean if you ask me 😉.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tech stack
&lt;/h2&gt;

&lt;p&gt;As I mentioned before, my overall tech stack for the project included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nextjs.org/"&gt;Next.js&lt;/a&gt; for JSX and state management&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://tailwindcss.com/"&gt;Tailwind CSS&lt;/a&gt; for styling&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://react-select.com/home"&gt;React Select&lt;/a&gt; for the menus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I decided to use Next.js and Tailwind CSS for the frontend mostly because they are fun to use, but also because they are very powerful. If you are new to frontend development and haven't heard of them yet, allow me to introduce you.&lt;/p&gt;

&lt;p&gt;Next.js is a JavaScript framework built on top of React.js--&lt;em&gt;another&lt;/em&gt; JavaScript framework. There are tons of reasons why you might want to use Next.js, but I chose it simply because it helps me develop applications &lt;strong&gt;fast&lt;/strong&gt;. If you're already comfortable with React, then you will &lt;em&gt;love&lt;/em&gt; Next.js.&lt;/p&gt;

&lt;p&gt;On top of Next.js, I used Tailwind CSS for the styles. This also helped move fast without requiring me to write a single line of CSS. I had to modify the Tailwind config file a bit more than I normally do, but overall, getting all the styling done with Tailwind was a very straight-forward experience.&lt;/p&gt;

&lt;p&gt;What helped the most for this app was using the &lt;code&gt;react-select&lt;/code&gt; library for the dropdown menus.&lt;/p&gt;

&lt;h2&gt;
  
  
  React Select is clutch
&lt;/h2&gt;

&lt;p&gt;Most people will not bother creating custom dropdown menus because it's nearly impossible to style them with plain CSS. For this app, I wanted to make the dropdowns match the design as closely as possible, so I had to find a solution.&lt;/p&gt;

&lt;p&gt;After looking through a few Stack Overflow posts and reading through &lt;a href="https://css-tricks.com/dropdown-default-styling/"&gt;this post&lt;/a&gt; on styling dropdowns by CSS Tricks, I realized that using normal styling would not be worth the trouble. So I did what you should do when you want to build something quick: I looked for a library.&lt;/p&gt;

&lt;p&gt;That's how I came across &lt;code&gt;react-select&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In short, &lt;code&gt;react-select&lt;/code&gt; is a library that makes it easy to create completely custom dropdown menus. All I had to do was pass in some custom styles into the style object and I was able to make the dropdowns look almost exactly like the design!&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;The main takeaway from building this app is that open-source libraries are &lt;em&gt;incredible&lt;/em&gt;. They made making this app a quick and almost completely painless process. On top of that, the code should be very readable for even beginner frontend developers.&lt;/p&gt;

&lt;p&gt;Another takeaway is that the next time I need a custom dropdown menu, I am definitely turning to &lt;code&gt;react-select&lt;/code&gt;. Using it was smooth as your hands are after washing them thoroughly for at least 20 seconds to avoid spreading the Coronavirus.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;From here on out, I plan to use this same stack to completely recreate applications that you or someone you know is using every day. If you are interested in learning more, join the email list to get updates on the process!&lt;/p&gt;

&lt;p&gt;And like always, I would love to hear your thoughts on the article, so do not hesitate to reach out on &lt;a href="https://twitter.com/kyrelldixon"&gt;Twitter&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>react</category>
    </item>
    <item>
      <title>How to Setup an Express.js Server in Node.js</title>
      <dc:creator>Kyrell Dixon</dc:creator>
      <pubDate>Fri, 23 Aug 2019 23:01:39 +0000</pubDate>
      <link>https://forem.com/kyrelldixon/how-to-setup-an-express-js-server-in-node-js-56hp</link>
      <guid>https://forem.com/kyrelldixon/how-to-setup-an-express-js-server-in-node-js-56hp</guid>
      <description>&lt;p&gt;This tutorial aims to show you how to use the Express framework and Node.js to get a simple server up and running completely from scratch. It goes into depth on different ways to test your server without needing to write a front-end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Terms
&lt;/h2&gt;

&lt;p&gt;It is far too easy to just copy-paste some code examples to get something running without ever really knowing what the code is doing.&lt;br&gt;
To prevent that, I am going to briefly define a few important terms and concepts to potentially help fill some conceptual gaps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;REST or RESTful Architecture&lt;/strong&gt;: REpresentational State Transfer or REST is a standardized way to design a code base for easy communication between a client and server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client&lt;/strong&gt;: Sends requests (think GET, POST, and DELETE for example) to the server. The client is often confused with the "front end" of an application, but there are distinct differences. &lt;em&gt;Anything&lt;/em&gt; that sends requests is a client and that includes a server, bash script, a website.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt;: Responds to requests from a client. A response can be many things, but the most common response from an API is a JSON file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSON&lt;/strong&gt;: JavaScript Object Notation is a standard way of formatting data that uses syntax from JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API (Application Programming Interface)&lt;/strong&gt;: Code that allows a client to interact with a server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you go through this tutorial, you will see more practical examples of these terms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;For this tutorial you will need a Unix shell to run the bash commands. On Mac and Linux you can use Terminal to run the commands with no problems. On Windows, you will want to use either &lt;a href="https://gitforwindows.org/" rel="noopener noreferrer"&gt;Git Bash&lt;/a&gt;, &lt;a href="https://itsfoss.com/install-bash-on-windows/" rel="noopener noreferrer"&gt;Linux for Windows&lt;/a&gt;, &lt;a href="https://cmder.net/" rel="noopener noreferrer"&gt;Cmder&lt;/a&gt;, or some other Unix shell.&lt;/p&gt;

&lt;p&gt;You will also need to have &lt;a href="https://nodejs.org/en/download/package-manager/" rel="noopener noreferrer"&gt;Node&lt;/a&gt; and &lt;a href="https://www.npmjs.com/get-npm" rel="noopener noreferrer"&gt;npm&lt;/a&gt; installed.&lt;/p&gt;

&lt;p&gt;To check if you have Node installed, open your terminal and run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

node &lt;span class="nt"&gt;-v&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To check if you have npm installed, open your terminal and run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm &lt;span class="nt"&gt;-v&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;With that out of the way, you can set up the project!&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up your project
&lt;/h2&gt;

&lt;p&gt;To get started, create and change into a folder for your project.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;mkdir &lt;/span&gt;express-tutorial &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$_&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here we used &lt;code&gt;$_&lt;/code&gt; which is an alias for the input of the last command. The input for the &lt;code&gt;mkdir&lt;/code&gt; command is &lt;code&gt;express-tutorial&lt;/code&gt;, so &lt;code&gt;cd $_&lt;/code&gt; translates to &lt;code&gt;cd express-tutorial&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt; I am using &lt;code&gt;git&lt;/code&gt; for version control with my folder, so I also did a &lt;code&gt;git init&lt;/code&gt; at this point. For the sake of simplicity, I'm going to leave &lt;code&gt;git&lt;/code&gt; out of this tutorial, but in an actual project now is a good time to start tracking your changes.&lt;/p&gt;

&lt;p&gt;From here we want to create a &lt;code&gt;package.json&lt;/code&gt; file that will keep track of our project dependencies and allow us to do some cool things later on. To do that run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm init &lt;span class="nt"&gt;-y&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will create a &lt;code&gt;package.json&lt;/code&gt; file and answer "yes" to all the questions because of the &lt;code&gt;-y&lt;/code&gt; flag.&lt;/p&gt;

&lt;p&gt;If you check out your &lt;code&gt;package.json&lt;/code&gt; file, it should look similar to this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"express-tutorial"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"index.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Error: no test specified&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; &amp;amp;&amp;amp; exit 1"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Kyrell Dixon"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"license"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"MIT"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If your &lt;code&gt;package.json&lt;/code&gt; is not exactly the same, that is perfectly fine. You can add in the fields you want to make it match, but I will point out which fields you need to look out for as this file changes.&lt;/p&gt;

&lt;p&gt;The last thing we need to get set up for now is adding in the Express framework. Express is the Node.js framework we will use to create the actual API endpoints, so we will need to install that package. To do that use:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm i express


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here &lt;code&gt;npm i&lt;/code&gt; is short for &lt;code&gt;npm install&lt;/code&gt; because the less letters you type, the less of a risk for carpal tunnel (and because the best developers are lazy).&lt;/p&gt;

&lt;p&gt;Running this command will add a few new files:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;.&lt;/span&gt;
├── node_modules &lt;span class="c"&gt;#new&lt;/span&gt;
├── package-lock.json &lt;span class="c"&gt;#new&lt;/span&gt;
└── package.json


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip&lt;/strong&gt;: To get this to display I used a command called &lt;code&gt;tree&lt;/code&gt;. &lt;a href="https://askubuntu.com/questions/431251/how-to-print-the-directory-tree-in-terminal" rel="noopener noreferrer"&gt;This&lt;/a&gt; link will help you install it on MacOS and Ubuntu.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;node_modules&lt;/code&gt; folder is where the Express framework code lives as well as all its dependencies. If you're using git, you want to make sure that you &lt;strong&gt;never&lt;/strong&gt; commit this folder unless absolutely necessary because it is &lt;em&gt;massive&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt; Check out &lt;a href="https://medium.com/better-programming/npkill-the-easy-solution-to-deleting-node-modules-with-style-1c591126f7a5" rel="noopener noreferrer"&gt;&lt;code&gt;npkill&lt;/code&gt;&lt;/a&gt; if you want a way of easily removing node_modules from unused projects on your computer.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;package-lock.json&lt;/code&gt; file is automatically generated primarily as a way of keeping track of your project dependencies, but it serves multiple purposes. For more information, check out the npm documentation's &lt;a href="https://docs.npmjs.com/files/package-lock.json" rel="noopener noreferrer"&gt;description of this file&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With that, we have all the initial setup done. for the project. Now we can get into creating the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Initial Server
&lt;/h2&gt;

&lt;p&gt;First we want to create a file to store our main server code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;touch &lt;/span&gt;index.js


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It is pretty standard to use an &lt;code&gt;index.js&lt;/code&gt; as the root file since this communicates to other developers that this is where your application starts from.&lt;/p&gt;

&lt;p&gt;However, if this is just a personal project that only you will see, feel free to have fun and name it what you want. It does not actually matter what you call the file.&lt;/p&gt;

&lt;p&gt;From here you want to take whatever you name the file and type out:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Server is listening on port: 1234&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So what's going on here?&lt;/p&gt;

&lt;p&gt;Line 1 takes care of importing the express package that you installed earlier into your server file.&lt;/p&gt;

&lt;p&gt;Line 3 calls the express function which returns an express application.&lt;/p&gt;

&lt;p&gt;Lines 5-7 tells your application to listen for any requests that come in on port 1234. For now you can think of a port as a more specific address for a url similar to a street number.&lt;/p&gt;

&lt;p&gt;To test out the code, go back to the command line and run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

node index.js &lt;span class="c"&gt;# or node your-filename.js&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you've followed every step until now, you should see a message in your terminal saying:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

Server is listening on port: 1234


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you don't, try to debug it! If you're getting some type of error message, try to decipher it yourself or just copy and paste it straight into Google.&lt;/p&gt;

&lt;p&gt;If all else fails, reach out and I or someone else in the community will gladly help.&lt;/p&gt;

&lt;p&gt;Once everything is working, you are almost ready to create some API endpoints! Well, &lt;em&gt;almost&lt;/em&gt; ready. First we want to do a quick refactoring of the port.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Quick Refactor of the &lt;code&gt;PORT&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;As a quick refactoring, we're going to move the port to it's own variable like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Server is listening on port: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This gets rid of what developers call a "magic number." A magic number is simply a number without a label. In this case, if we didn't explicitly save &lt;code&gt;1234&lt;/code&gt; in the &lt;code&gt;PORT&lt;/code&gt; constant, anyone reading the code would have no idea what that number was there for.&lt;/p&gt;

&lt;p&gt;Another subtle benefit is that we can now reuse the PORT variable in the &lt;code&gt;console.log&lt;/code&gt; so that if we change the PORT, we only have to change it in one place.&lt;/p&gt;

&lt;p&gt;Simple refactors like this help you have clean code that is easy to understand and work with.&lt;/p&gt;

&lt;p&gt;With that out of the way, we can get into creating the API endpoints.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating REST API Endpoints
&lt;/h2&gt;

&lt;p&gt;The first endpoint we'll create will handle a GET request.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello world&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Server is listening on port: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Let's break this down.&lt;/p&gt;

&lt;p&gt;First we have &lt;code&gt;app.get("/hello", ...)&lt;/code&gt; which tells the server that we want to be able to handle a GET request to the &lt;code&gt;/hello&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;Following the endpoint is &lt;code&gt;(req, res) =&amp;gt; {...}&lt;/code&gt; which is an ES6 &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="noopener noreferrer"&gt;arrow function&lt;/a&gt; that takes two parameters &lt;code&gt;req&lt;/code&gt; and &lt;code&gt;res&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The first parameter &lt;code&gt;req&lt;/code&gt; is a variable that stores all the information for the incoming &lt;code&gt;req&lt;/code&gt;uest from the client. The server &lt;code&gt;res&lt;/code&gt;ponse functions are stored in the &lt;code&gt;res&lt;/code&gt; parameter.&lt;/p&gt;

&lt;p&gt;In this case we are using &lt;code&gt;res.send&lt;/code&gt; to respond with the string &lt;code&gt;"Hello world"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So after getting the server up and running how do you test it out? I'm going to cover three ways to test out the api endpoint without having to write a line of code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three ways to test API endpoints
&lt;/h2&gt;

&lt;p&gt;To test out the &lt;code&gt;"/hello"&lt;/code&gt; endpoint, we want to send a GET request to the full server url at &lt;code&gt;localhost:1234/hello&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We are using &lt;code&gt;localhost&lt;/code&gt; since we are running the server locally and &lt;code&gt;:1234&lt;/code&gt; since that is the port the server is listening on.&lt;/p&gt;

&lt;p&gt;The first way to test this out will be in the browser!&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing a GET endpoint from the browser
&lt;/h3&gt;

&lt;p&gt;Pop open Chrome, Firefox, Safari, or whatever browser you're comfortable with. Just please, &lt;strong&gt;PLEASE&lt;/strong&gt; don't use Internet Explorer. Microsoft, it's creator, &lt;a href="https://www.theverge.com/2019/2/8/18216767/microsoft-internet-explorer-warning-compatibility-solution" rel="noopener noreferrer"&gt;doesn't even want you to&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you're getting an error, make sure to restart your server with &lt;code&gt;ctrl+c&lt;/code&gt; followed by a &lt;code&gt;node index.js&lt;/code&gt;. (I'll show you a way to avoid errors from forgetting to restart your server a little later.)&lt;/p&gt;

&lt;p&gt;Your browser should look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2Fe0ab551bfccd1e9eab4bb2da69714864%2F4b668%2Fhello-endpoint.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2Fe0ab551bfccd1e9eab4bb2da69714864%2F4b668%2Fhello-endpoint.webp" alt="Hello world endpoint in browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why does this work?&lt;/p&gt;

&lt;p&gt;Whenever you go to the address bar in your browser, it is actually doing a GET request to whatever URL you give it. So every time you go to google.com for example, your browser is doing a GET and the Google server is sending you the HTML, CSS, and JavaScript needed to display the Google search bar.&lt;/p&gt;

&lt;p&gt;The GET route for the &lt;code&gt;"hello"&lt;/code&gt; endpoint is currently sending down the string &lt;code&gt;"Hello world"&lt;/code&gt;, but we could have it send pretty much any document containing text--which is all a JSON or HTML file really is.&lt;/p&gt;

&lt;p&gt;A browser is great for quickly testing our GET endpoints, but if you need to test any other type of request like a POST or DELETE, you will need a different method entirely. This next method will show you how to test your endpoints entirely from the command line using cURL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test any API endpoints from the command line with cURL
&lt;/h3&gt;

&lt;p&gt;Sometimes you want to quickly test your API endpoint without having to leave your code editor. If you are working with Visual Studio Code, then you can test your API endpoints without needing to open up another app. (If not, you can open up the terminal and still take advantage of this method.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt; Use Visual Studio Code. It's the best.&lt;/p&gt;

&lt;p&gt;To test your endpoints with cURL, go to your command line and type:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

curl localhost:1234/hello


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You should get the same &lt;code&gt;"Hello world"&lt;/code&gt; response that you got from the browser.&lt;/p&gt;

&lt;p&gt;With cURL you can also do other types of requests like POST, PUT, and DELETE, modify headers, use cookies, and pretty much anything else you need to test out an API. It's a very powerful tool to learn, but if you're not a fan of working with a command line it can get tedious.&lt;/p&gt;

&lt;p&gt;This is where the final solution comes in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing your API endpoints with Postman
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2F01a21035897cd75cbf2b94e1b14e9acf%2Fc3bcd%2Fpostman.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2F01a21035897cd75cbf2b94e1b14e9acf%2Fc3bcd%2Fpostman.webp" alt="Postman front-page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.getpostman.com/" rel="noopener noreferrer"&gt;Postman&lt;/a&gt; provides a nice GUI (pronounced "gooey"), or Graphical User Interface, to easily make requests to your endpoints. I personally use this most out of the techniques mentioned because it just makes APIs so easy to test. It is especially useful as your APIs grow in complexity and you have a wide variety of endpoints to test.&lt;/p&gt;

&lt;p&gt;In this case, all you need to do is pass in the url as shown in the image above and hit send. The &lt;code&gt;"Hello world&lt;/code&gt; response shows up like normal, but you can also see the headers that get sent back with the response.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2F3b6bb5b0c4a95ed92e088510a529494a%2F78593%2Fpostman-headers.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2F3b6bb5b0c4a95ed92e088510a529494a%2F78593%2Fpostman-headers.webp" alt="Postman headers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can think of headers as simply data about a request or response. In the image you can see an &lt;code&gt;X-Powered-By: Express&lt;/code&gt; header that tells you Express is responsible for sending this response.&lt;/p&gt;

&lt;p&gt;Another notable header is the &lt;code&gt;Content-Type&lt;/code&gt; header that lets the client know how to interpret the body of the response. Here it is &lt;code&gt;text/html; charset=utf-8&lt;/code&gt; since that is the default &lt;code&gt;Content-Type&lt;/code&gt; when using &lt;code&gt;res.send&lt;/code&gt; for the response.&lt;/p&gt;

&lt;p&gt;There are several other default headers that Postman parses out and makes it easy to see, but in each of the techniques, the exact same headers and response body were sent. This just shows that using different tools have various pros and cons, and sometimes you can learn just by trying different ways to accomplish the same task.&lt;/p&gt;

&lt;p&gt;Now that testing is out of the way, I want to show an optional way to prevent a common mistake you will inevitably run into in your career.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Reduce development errors with &lt;code&gt;nodemon&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Anytime you make changes to your server you have to stop and restart the server to be able to test those changes. Forgetting to restart the server can lead to hours of frustration and doubt because you think your code isn't working when in reality the server just hasn't loaded the changes.&lt;/p&gt;

&lt;p&gt;If you haven't felt this struggle you are one of the lucky few. This tip will make it so you never encounter it. The solution is to install an npm package called &lt;code&gt;nodemon&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;nodemon&lt;/code&gt;, you will never have to manually restart your server. It runs in the background and watches all your files for changes. When it detects one, it will automatically restart the server so you can focus on writing code.&lt;/p&gt;

&lt;p&gt;To get started you will need to install it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm i &lt;span class="nt"&gt;--save-dev&lt;/span&gt; nodemon


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here you use the &lt;code&gt;--save-dev&lt;/code&gt; or alternatively the &lt;code&gt;-D&lt;/code&gt; flag to add nodemon to you &lt;code&gt;devDependencies&lt;/code&gt; in the &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Your &lt;code&gt;package.json&lt;/code&gt; file should now contain an object similar to this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"nodemon"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.19.1"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We added it to the &lt;code&gt;devDependicies&lt;/code&gt; since this is just a convenient way to run the server to make development easier and isn't required to have a working application.&lt;/p&gt;

&lt;p&gt;To use &lt;code&gt;nodemon&lt;/code&gt; to run the server, first you want to add a &lt;code&gt;"start"&lt;/code&gt; script to the &lt;code&gt;package.json&lt;/code&gt; in the &lt;code&gt;"scripts"&lt;/code&gt; object:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"nodemon index.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Error: no test specified&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; &amp;amp;&amp;amp; exit 1"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then to run the server it you can use:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm start


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This should create a display that looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2F0847f9990467c8ed1ebfe4e10ffb0913%2Fa0dba%2Fnodemon.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.kyrelldixon.com%2Fstatic%2F0847f9990467c8ed1ebfe4e10ffb0913%2Fa0dba%2Fnodemon.webp" alt="Nodemon output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another way to work with &lt;code&gt;nodemon&lt;/code&gt; is to do a global install that will allow you to run it from the command line for &lt;em&gt;any&lt;/em&gt; project without needing to install it as a &lt;code&gt;devDependency&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To do that run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

npm i &lt;span class="nt"&gt;-g&lt;/span&gt; nodemon


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This installs the package system-wide instead of just for the specific project. This allows you to simply run &lt;code&gt;nodemon index.js&lt;/code&gt; from the command line without having to set up a script in the &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finishing up
&lt;/h2&gt;

&lt;p&gt;This tutorial has covered the inital set up of an Express server, creating a GET endpoint, and testing the endpoint with &lt;code&gt;cURL&lt;/code&gt;, a browser, and Postman.&lt;/p&gt;

&lt;p&gt;You should now have everything you need to explore and test other types of endpoints. With that, I'll leave you with a few practical exercises for those that want to go beyond what this tutorial has shown.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exercises
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Push your code to GitHub&lt;/li&gt;
&lt;li&gt;Add POST, PUT, and DELETE endpoints to the server&lt;/li&gt;
&lt;li&gt;Read through the Express.js &lt;a href="https://expressjs.com/en/api.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create a simple form and connect it to the server&lt;/li&gt;
&lt;li&gt;Deploy the server on &lt;a href="https://www.digitalocean.com/" rel="noopener noreferrer"&gt;DigitalOcean&lt;/a&gt; or a serverless cloud provider&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any questions or feedback, reach out to me on &lt;a href="https://www.twitter.com/kyrelldixon" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
