L21. Designing Your Own REST API
CSCI 344: Advanced Web Technologies
Spring 2026
Announcements
Outline
Outline
What is a service?
On a Mac: lsof -i -P | grep -i "listen"
On a Windows: Control Panel > Administrator Tools > Service Icon
What is a port?
Read more here
What is an http://127.0.0.1?
What is a web server
Web servers are services that are listening to HTTP traffic. They are constantly running (i.e., an infinite event loop) and listening to incoming traffic.
In Tutorial 11, you are going to create one of these web services that listens for traffic.
How does GitHub Pages work?
Static Web Page
Architecture
(Homework 2)
Outline
What is a database?
A database is an organized collection of structured information, or data, typically stored electronically in a computer system.
How is this better than just storing data in a text file?
Why would you want to use a database?
Why would you want to use a database?
Types of Databases
There are many different kinds of databases, but the two most common “families” of databases are:
Types of Databases: Relational (SQL) Databases
Types of Databases: NoSQL Databases
Your REST API will use a database
You will be using SQLite to organize your data.
Outline
Building a REST API
What kinds of things do we need to think about when building a REST API?
Server-Side Architecture
Activity: Design an Online Shoe store
You are going to design an API blueprint for an online show store. Therefore, you’re going to have to make some decisions about:
Let’s keep it simple
This system can be complex, but let’s keep it simple by only designing allowing the user to interact with 3 Resources:
Sneakers
Favorites
Orders
Let’s build this thing!
npm install # installs dependencies
npm run generate # generates the API from the YAML file
npm run seed # inserts some fake data
npm run dev # starts the server
ngrok http 3100 # Sarah-only: share with the class…