Skip to content

SaxBuddha/Notes-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes-App

To run, download the package and npm i node. Then: node server.js .

Here I've made a straightforward app that can be used for taking notes. The app is is made in Node and Express, and leverages the mongoose module to handle much of the API functionality. The data is stored on MongoDB's cloud service Atlas. I will use Postman here to demonstrate the endpoints.

I will mention that I have provided error handling for most of the functions. I do not show that here just to save space, but stuffice it to say that most of the wrong inputs a user could put in have an appropriate error response.

Onto showing the API endpoints!

POST: Every note creation has a unique id associated with it, given to use by default by mongoose. image

GET: get-all returns all of our notes. image

GET: We can retrieve any particular note with the noteId. image

PUT: Editing a note with Id. image

GET: The search function works by finding any matching keywords within the note contents, not the Id. image

DELETE: Finally, we can delete by a particular note Id. image

TODO Currently, I am working on two further functionalities:

1.) Refactoring the POST function so that it can either take in a single {note: String} JSON object (see my model file) or an array of multiple notes: i.e.: {["batch": {"note1": "first"}, {"note2": "second"}, ..., {"note3": "third"}]} . Getting mongoose to properly parse that object has been challenging. I can get the array itself to pass, but not its contents.

2.) Similarly, refactoring the DELETE function to delete an array of Ids, such as {[{"note":"id",...,"note":"id"}]}.

Further goals:

The next logical step is to of course connect this back end with a front end. Given the current tech in the stack, React seems like a clear choice here. Additionally, unit testing would be a good addition, even for a small project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published