Skip to content

Skylar-Lorena/notes_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Note-Taking API

A minimal REST API built using Rust and Actix Web to store and retrieve text notes.

Features

  • Create and view notes
  • Simple JSON-based API
  • In-memory storage using Mutex
  • Built with Rust’s safety and performance guarantees

Requirements

  • Rust (1.80+) — Install via rustup
  • Cargo (comes with Rust)
  • Editor: VS Code + Rust Analyzer

Setup Instructions

# Clone this repository
git clone https://github.com/Skylar-Lorena/notes_api
cd notes_api

# Run the app
cargo run

Server runs at: http://127.0.0.1:8080

API Endpoints

➕ POST /notes

Create a new note.

Request:

{
  "id": 1,
  "title": "My first note",
  "content": "Learning Rust is fun!"
}

Response: 201 Created

📄 GET /notes

Retrieve all notes.

Response:

[
  { "id": 1, "title": "My first note", "content": "Learning Rust is fun!" }
]

Common Issues

Error Solution
Address already in use Stop previous instance or use another port
serde not found Add serde to Cargo.toml with derive feature
thread '<main>' panicked at 'unwrap' Replace with expect() or proper error handling
error: linker 'cc' not found Install a C compiler (e.g., gcc) and ensure it's in your system PATH

References

Author

Built by Lorenah M. for the “New Stack Learning” mini-project using GenAI for setup, debugging, and documentation.

About

Rust Note-Taking API: A minimal RESTful API built with Rust and Actix Web, designed as a learning project to explore Rust’s safety, concurrency, and performance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages