A simple and effective CRUD API built using Node.js and Express. This project serves as a lightweight boilerplate for developers who want to create RESTful Web APIs with basic CRUD functionalities (Create, Read, Update, Delete) in Node.js using the Express framework.
- Lightweight and minimal setup
- Built entirely with Node.js and Express
- In-memory data storage (no external database required)
- Full CRUD endpoints:
GET /api/items– Retrieve all itemsGET /api/items/:id– Retrieve an item by IDPOST /api/items– Create a new itemPUT /api/items/:id– Update an existing itemDELETE /api/items/:id– Delete an item
-
Clone this repository or download the ZIP.
-
Navigate to the project folder:
cd NodeJS-Express-CRUD-API-Sample- Install dependencies:
npm install- Start the server:
npm startThe API server will be running at:
http://localhost:3000
You can test the API using tools like Postman or curl.
POST /api/items
Content-Type: application/json
{
"name": "My New Item"
}GET /api/itemsGET /api/items/1PUT /api/items/1
Content-Type: application/json
{
"name": "Updated Item"
}DELETE /api/items/1- This project uses an in-memory JavaScript array to store data. All items are lost when the server restarts.
- The code is fully self-contained and meant for educational purposes, prototyping, and quick tests.
- No database is required or configured.
For a detailed explanation and walkthrough of the code, please refer to the original article published on Ryadel.com:
This project is open-source and available under the MIT License.