https://github.com/dxtaner/nestednoteswebapi
NestedNotes
https://github.com/dxtaner/nestednoteswebapi
api asp-net-mvc dbcontext notes-app webapi
Last synced: 8 months ago
JSON representation
NestedNotes
- Host: GitHub
- URL: https://github.com/dxtaner/nestednoteswebapi
- Owner: dxtaner
- Created: 2023-02-22T15:57:28.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-11T15:56:59.000Z (almost 3 years ago)
- Last Synced: 2025-03-13T03:17:29.559Z (about 1 year ago)
- Topics: api, asp-net-mvc, dbcontext, notes-app, webapi
- Language: C#
- Homepage:
- Size: 3.21 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Notes API
=========
Endpoints
---------
### GET /api/notes
Retrieves all the notes.
GET /api/notes
### GET /api/notes/{id}
Retrieves a specific note by its ID.
GET /api/notes/{id}
### POST /api/notes
Creates a new note.
POST /api/notes
### DELETE /api/notes/{id}
Deletes a note and its child comments recursively.
DELETE /api/notes/{id}
Error Handling
--------------
If an error occurs while processing a request, the API will respond with an appropriate error message and status code.
{
"message": "Internal server error: An exception occurred.",
"status": 500
}
Database
--------
The API uses a database to persist notes and comments. The connection string and database provider are configured in the `appsettings.json` file.
Getting Started
---------------
1. Clone the repository: `git clone https://github.com/your-username/notes-api.git`
2. Navigate to the project directory: `cd notes-api`
3. Restore the NuGet packages: `dotnet restore`
4. Update the database connection string in `appsettings.json` if necessary.
5. Apply the database migrations: `dotnet ef database update`
6. Run the API: `dotnet run`
7. The API will be accessible at `http://localhost:5000/api/notes`
Dependencies
------------
The API depends on the following NuGet packages:
* Microsoft.AspNetCore.Mvc
* Microsoft.EntityFrameworkCore
These packages will be automatically restored when you run the `dotnet restore` command.