# Unit 11 Express Homework: Note Taker ## Description Create an application that can be used to write, save, and delete notes. This application will use an express backend and save and retrieve note data from a JSON file. * The application frontend has already been created, it's your job to build the backend and connect the two. * The following HTML routes should be created: * GET `/notes` - Should return the `notes.html` file. * GET `*` - Should return the `index.html` file * The application should have a `db.json` file on the backend that will be used to store and retrieve notes using the `fs` module. * The following API routes should be created: * GET `/api/notes` - Should read the `db.json` file and return all saved notes as JSON. * POST `/api/notes` - Should receive a new note to save on the request body, add it to the `db.json` file, and then return the new note to the client. * DELETE `/api/notes/:id` - Should receive a query parameter containing the id of a note to delete. This means you'll need to find a way to give each note a unique `id` when it's saved. In order to delete a note, you'll need to read all notes from the `db.json` file, remove the note with the given `id` property, and then rewrite the notes to the `db.json` file. ## User Story AS A user, I want to be able to write and save notes I WANT to be able to delete notes I've written before SO THAT I can organize my thoughts and keep track of tasks I need to complete ## Business Context For users that need to keep track of a lot of information, it's easy to forget or be unable to recall something important. Being able to take persistent notes allows users to have written information available when needed. ## Acceptance Criteria Application should allow users to create and save notes. Application should allow users to view previously saved notes. Application should allow users to delete previously saved notes. ## Deploying the App You will not be able to deploy your server side code on GitHub pages. This app should be deployed on Heroku. Carefully follow the [Heroku Guide](../04-Supplemental/HerokuGuide.md) for getting your app deployed on Heroku. - - - ## Commit Early and Often One of the most important skills to master as a web developer is version control. Building the habit of committing via Git is important for two reasons: * Your commit history is a signal to employers that you are actively working on projects and learning new skills. * Your commit history allows you to revert your codebase in the event that you need to return to a previous state. Follow these guidelines for committing: * Make single-purpose commits for related changes to ensure a clean, manageable history. If you are fixing two issues, make two commits. * Write descriptive, meaningful commit messages so that you and anyone else looking at your repository can easily understand its history. * Don't commit half-done work, for the sake of your collaborators (and your future self!). * Test your application before you commit to ensure functionality at every step in the development process. We would like you to have well over 200 commits by graduation, so commit early and often! ## Submission on BCS You are required to submit the following: * The URL of the deployed application. This should be the link to the url provided by Heroku. Be sure not to submit a link to the Heroku dashboard. * The URL of the GitHub repository - - - © 2019 Trilogy Education Services, a 2U, Inc. brand. All Rights Reserved.
Stars
1
Forks
1
Watchers
1
Open Issues
0
Overall repository health assessment
^4.17.1^1.10.0^8.3.0^2.0.419
commits
I structured the readme.md in the manner that I did with my other applications; including a screen shot and my url.
cd6cdf0View on GitHubI removed the random uuid const that I had at the top of the code and formatted.
10fb52fView on GitHubI included the uuid section in the post and delete routes inside the function.
0b0d373View on GitHubI added the the readfile to the app.post and was able to see that my post is working. I also added __dirname to the readfile in the post function as it wasn't prior, formatted, and added comments.
d2ef208View on GitHubI removed the node modules by adding them to the gitignore file. I also added the route for /notes to the html in the server.js file.
e6c7bb2View on GitHubI was able to add the uuid import as well as include the id: uuid() function in the .js code. I the ran npm install uuid as i noticed that UUIDV4 was deprecated.
31967c1View on GitHubI added comments and formatting. As of now the server does work as I have opened localhost:8080 in the browser and see the note taker (get started) page.
b3b992eView on GitHubI added the listener so that I could make my server listen and passed in the port (8080) and the callback function.
a289c9eView on GitHubI fixed some syntax errors and pushed the variables to the top and I am unable to connect with localhost:8080 in the browser still. Going back over notes.
545fb3dView on GitHubI aadded my middleware and comments as well up to this point.
901b864View on GitHub