How fernandoyaguana/restapi works
Project Type and Purpose
• This is a simple backend microservice (Node.js + Express) implementing a REST API that returns a “Hello World” JSON message. It can be run locally or as a Docker container.
Key Components
a. Client (Browser or API client such as Postman)
b. HTTP Layer (REST API interface)
c. Express.js Application
• index.js (route definition, server startup)
• node_modules (runtime libraries, e.g., express)
d. Node.js Runtime
e. Containerization Layer (Docker Engine + Dockerfile)
f. Deployment Artifact (Docker Image in Docker Hub)
Relationships and Data Flow
• The client issues an HTTP GET request to http://localhost:3000/.
• The Docker Engine routes the request into the running container.
• Inside the container the Node.js runtime loads Express, which dispatches to the route handler in index.js.
• Express builds a JSON response ({ "message": "Hola Mundo Desde RestApi" }) and sends it back along the same path.
Architectural Patterns and Principles
• REST architectural style: stateless HTTP service, JSON over HTTP.
• Single-responsibility: index.js only defines routing and response.
• Containerization: isolation and portability via Docker.
Technologies and Artifacts
• Node.js (runtime environment)
• Express.js (web framework)
• Dockerfile → Docker Image → Docker Container
• GitHub Repo (source code) and Docker Hub (image registry)
• Clear labels for all components.