Skip to content

A simple API that supports CRUD operations with in-memory storage.

License

Notifications You must be signed in to change notification settings

idematos/actix-web-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Actix Web API

This is a simple REST API built with Actix Web that supports CRUD operations with an in-memory data store.

Prerequisites

Running

Start the API server:

cargo run

By default, the server will be running at http://127.0.0.1:8080.

API Endpoints

Get All Items

GET /items

Response:

[
  {
    "id": "item-id-1",
    "name": "Item Name",
    "quantity": 10
  },
  {
    "id": "item-id-2",
    "name": "Another Item",
    "quantity": 5
  }
]

Get Single Item

GET /items/{id}

Response:

{
  "id": "item-id",
  "name": "Item Name",
  "quantity": 10
}

Add New Item

POST /items

Request Body:

{
  "name": "New Item",
  "quantity": 12
}

Response:

{
  "id": "newly-generated-id",
  "name": "New Item",
  "quantity": 12
}

Delete Item

DELETE /items/{id}

Response:

Status: 200 OK

About

A simple API that supports CRUD operations with in-memory storage.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages