https://github.com/michaelradu/simple-express-api
Simple REST API implemented in Express for learning purposes.
https://github.com/michaelradu/simple-express-api
Last synced: about 1 year ago
JSON representation
Simple REST API implemented in Express for learning purposes.
- Host: GitHub
- URL: https://github.com/michaelradu/simple-express-api
- Owner: michaelradu
- License: gpl-3.0
- Created: 2022-08-08T10:50:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-08T10:51:44.000Z (almost 4 years ago)
- Last Synced: 2025-01-29T14:15:47.288Z (over 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Express REST API
This is an example of a basic RESTful API implemented in Express for educational purposes. The code only implements GET and POST, is self-explanatory and has comments explaining each and every step of the process to make learning easier.
## What's an API?
An API (application programming interface) is simply some software that sends some information back and forth between an app and a user.
## What's REST/a RESTful API?
REST is a set of constraints [(listed here)](https://www.redhat.com/en/topics/api/what-is-a-rest-api#rest), not a standard or protocol, that API developers can implement to create a "RESTful API". REST supports many protocols but the most used one is **HTTP**. When a request is made with an *HTTPRequest* the RESTful API responds with a *HTTPResponse*, typically containing data in the **JSON** or **XML** format.
REST APIs can be used to perform different actions and support the following 5 methods:
* **GET** - Retrieve existing data from a database/server.
* **POST** - Create new data
* **PUT** - Replace existing data.
* **PATCH** - Update existing data.
* **DELETE** - Delete existing data.
## What's Express?
Express is just a Node.js framework that simplifies the process of building a RESTful API.