Intro to backend development
and Node.js
Seoul National University of Science and Technology
Information Technology Management
Lecture slides index
April 26, 2026
Question
How do real applications store and manage data?
Key idea
Servers enable applications to:
Application Layer (Backend / Business Logic)
Data Layer (Database)
| Name | Year | Description |
|---|---|---|
| Monolithic | before 2000 | Single unit of code, components share the same resources and deployment |
| Tiers and Layers | 2000s | Separation into presentation, business logic, and data layers. Each layer performs a specific function |
| Service Oriented Architecture | Early 2000s | Applications are composed of reusable services. Services communicate through well-defined interfaces (e.g., web services) |
| Microservices | Mid 2010s | Application is divided into small, independent services. Services communicate through APIs. Enables independent deployment and scaling |
Key idea:

| Method | Operation | Example |
|---|---|---|
| GET | Retrieve data from a resource | - GET /flights → retrieve all flights - GET /flights/123 → retrieve a specific flight |
| POST | Create a new resource | POST /flights → create a new flight |
| PUT / PATCH | Update an existing resource - PUT: replace entire resource - PATCH: update part of the resource |
- PUT /flights/123 → update a flight |
| DELETE | Remove a resource | - DELETE /flights/123 → delete a flight |
| Status code | Description | Example |
|---|---|---|
| 200 OK | Request was successful | - GET /flights/123 → 200 OK |
| 201 Created | Resource was successfully created | POST /flights → 201 Created |
| 400 Bad Request | Invalid request (e.g., missing or incorrect parameters) | POST /flights (invalid data) → 400 Bad Request |
| 401 Unauthorized | Authentication is required or failed | GET /flights/123 (without authorization) → 401 Unauthorized |
| 404 Not Found | Requested resource does not exist | GET /flights/999 → 404 Not Found |
| 500 Internal Server Error | Server encountered an unexpected error | GET /flights/567 → 500 Internal Server Error |
Key idea
A well-designed API should follow consistent and predictable patterns
API endpoints should be simple, consistent, and easy to understand
/flights/flights, /users, /posts/users/123/posts/api/v1/flights| Good (Recommended) | Avoid (Not Recommended) |
|---|---|
/flights |
/getFlights |
/users |
/userList |
/posts |
/fetchPosts |
/users/123/posts |
/getUserPosts |
/api/v1/flights |
/flightsV1 |
| Type | Approach | Typical Use Case |
|---|---|---|
| REST (Architectural Style) |
- Resource-based (URLs represent data) - Uses HTTP methods (GET, POST, etc.) - Simple, flexible, widely used |
Public APIs, web apps |
| GraphQL (Query Language) |
- Client specifies exactly what data it needs - Single endpoint - Reduces over-fetching and under-fetching |
Flexible frontend data |
| gRPC (Communication Framework) |
- Based on Remote Procedure Calls (RPC) - Uses Protocol Buffers (binary format) - High performance, often used for service-to-service communication |
Microservices communication |
| SOAP (Protocol) |
- XML-based messaging protocol - Strict structure and formal contracts - Common in legacy and enterprise systems |
Legacy enterprise systems |
API endpoints can be tested without building a frontend
Key idea
Postman allows you to interact with APIs directly, without a frontend
In this practical session, we will move from concepts to implementation.
We will use:
Our example in this session will be:
/flightsGoal
Build and run a simple local API that returns flight data
window and documentdocumentwindowClient-side
document, window, and the DOMfetchServer-side
flights-api)app.js filenpm init to initialize a package.json filenpm installapp.jsnpm (Node Package Manager) helps install and manage dependencies used by your projectapp.jsnpm install express to install the Express.js packageconst express = require('express');
const app = express();
const PORT = 8080;
app.get('/flights', function (req, res) {
const flights = [
{ id: 1, origin: "Seoul", destination: "Tokyo" },
{ id: 2, origin: "Paris", destination: "London" }
];
res.json(flights);
});
app.listen(PORT, () => {
console.log(`Our Node app is listening on port ${PORT}`);
});Important
package.json: stores metadata about the project, including its name, version, dependencies, scripts, and configuration.
package-lock.json: is generated automatically by npm and locks the exact versions of installed dependencies, helping ensure consistent installations across environments.
.js file with Node.js, you have access to standard JavaScript functions (e.g. console.log)require() functionexpress is the module we use to create our web serverapp.listen()app.listen() function starts the serverNote
localhost refers to your own computer.
When you open http://localhost:8080, you are connecting to a server running on your machine.
GET methodapp.get() allows us to create a GET endpointreq is the request object
res is the response object
In this example, the server sends JSON data back to the client using res.json(...)
If the visited endpoint has no matching route in your Express app, the server returns 404 (Not Found)
res.json(...) for this purposehttp://localhost:8080/flightsTip
Postman allows you to test your API without building a frontend

Web Programming