TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/brandonvergara1220-del/Mini-Proyecto-Backend-NodeJS/llms.txt
Use this file to discover all available pages before exploring further.
index.html file is the only user-facing interface in Mini Proyecto Backend NodeJS. It renders a simple registration form for Tienda Parque 100 — a store registration page — that collects a visitor’s first and last name and submits them to the Node.js backend for processing. No JavaScript framework, build tool, or stylesheet is involved; the file is plain HTML that any browser can render directly.
Full Source
Form Element: action and method
The <form> tag carries two attributes that control where and how the data is sent when the user clicks Enviar:
| Attribute | Value | Meaning |
|---|---|---|
action | "recuperardatos" | The relative URL the browser will submit to. Because this page is served from the Node.js server root, the full request path becomes POST /recuperardatos. The server must define a route handler for this path. |
method | "post" | Instructs the browser to send an HTTP POST request. Form field values are placed in the request body rather than appended to the URL as query parameters, which is the conventional choice for data that will be stored in a database. |
Form Fields
The form contains two text inputs, each paired with a<label> for accessibility:
nombre — First Name
name="nombre"— This is the key used in the POST body. Whenserver.jsis implemented with a body parser, the submitted value will be accessible asreq.body.nombre(or equivalent depending on the parsing library used).type="text"— Accepts any string input with no browser-side format validation.id="nombre"/for="nombre"— Links the label to the input so clicking the label text focuses the field.
apellido — Last Name
name="apellido"— Will be accessible asreq.body.apellidoonce the server-side body parser is implemented.- Same
type,id, andlabelpattern asnombre.
How Form Data Reaches the Server
When the user clicks Enviar, the browser serialises the two inputs intoapplication/x-www-form-urlencoded format and sends a POST request:
POST /recuperardatos route because that is the value of the form’s action attribute. The Node.js server.js file — currently empty and awaiting implementation — is where the route handler for this path will be defined. Once implemented, the handler will parse the URL-encoded body to extract nombre and apellido, then use the conexion module to persist the data to the ejemploformulario MySQL database.