Welcome to the Basic API Example repository! This project is designed to help beginners understand the basics of API development using Node.js and Express.js. It also includes a simple HTML form that interacts with the API, demonstrating how client-server communication works.
- Introduction
- Project Structure
- API Endpoints
- HTML Form
- Running the API
- Testing the API
- How This Repository Helps
- Additional Resources
- License
This project provides a straightforward example of a Node.js and Express.js API. It includes a single endpoint that handles POST requests. By submitting data through an HTML form, users can see how data is sent to the server and how the server responds. This example is intended for educational purposes and is great for those who are new to backend development and API design.
The project consists of the following key files:
server.js
: The main server file that sets up the Express application and defines API routes.public/index.html
: The HTML file with a form to send data to the API.package.json
: Contains project dependencies and scripts.README.md
: This file.
- Description: This endpoint receives data sent from the HTML form and responds with a confirmation message.
- Request Body: The body of the POST request should be a JSON object containing the
name
field.{ "name": "string" }